2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 21:47:42 +00:00

Fix CIOWinManager crash when attempting to distribute messages

This commit is contained in:
2017-01-27 01:21:02 -08:00
parent b7d2ae45f7
commit 8292e8abaa
5 changed files with 157 additions and 168 deletions

View File

@@ -62,17 +62,18 @@ void CIOWinManager::Draw() const
bool CIOWinManager::DistributeOneMessage(const CArchitectureMessage& msg,
CArchitectureQueue& queue)
{
CArchitectureMessage tmpMsg = msg;
for (IOWinPQNode* node = x4_pumpRoot ; node ; node = node->x8_next)
{
CIOWin* iow = node->GetIOWin();
CIOWin::EMessageReturn mret = iow->OnMessage(msg, x8_localGatherQueue);
CIOWin::EMessageReturn mret = iow->OnMessage(tmpMsg, x8_localGatherQueue);
while (x8_localGatherQueue)
{
CArchitectureMessage msg = x8_localGatherQueue.Pop();
if (msg.GetTarget() == EArchMsgTarget::IOWinManager)
tmpMsg = x8_localGatherQueue.Pop();
if (tmpMsg.GetTarget() == EArchMsgTarget::IOWinManager)
{
if (OnIOWinMessage(msg))
if (OnIOWinMessage(tmpMsg))
{
x8_localGatherQueue.Clear();
queue.Clear();
@@ -80,7 +81,7 @@ bool CIOWinManager::DistributeOneMessage(const CArchitectureMessage& msg,
}
}
else
queue.Push(std::move(msg));
queue.Push(std::move(tmpMsg));
}
switch (mret)