[*] harden

This commit is contained in:
Reece Wilson 2024-03-13 05:37:51 +00:00
parent cac3746bf0
commit 582b32ded9

View File

@ -280,7 +280,7 @@ namespace Aurora::IO
void IOProcessor::FrameRunAlerted() void IOProcessor::FrameRunAlerted()
{ {
for (auto &a : this->items.onTickReceivers) for (const auto &a : this->items.onTickReceivers)
{ {
if (a->pListener) if (a->pListener)
{ {
@ -300,10 +300,10 @@ namespace Aurora::IO
} }
} }
SysAssert(AuTryInsert(this->items.finalizeQueue, a)); SysAssert(AuTryInsert(this->items.finalizeQueue, AuConstReference(a)));
} }
for (auto &a : this->items.workSignaled) for (const auto &a : this->items.workSignaled)
{ {
if (a->pListener) if (a->pListener)
{ {
@ -318,7 +318,7 @@ namespace Aurora::IO
} }
} }
SysAssert(AuTryInsert(this->items.finalizeQueue, a)); SysAssert(AuTryInsert(this->items.finalizeQueue, AuConstReference(a)));
} }
} }
@ -744,13 +744,16 @@ namespace Aurora::IO
AU_LOCK_GUARD(this->items.mutex); AU_LOCK_GUARD(this->items.mutex);
this->items.allItems.push_back(item); if (!AuTryInsert(this->items.allItems, AuConstReference(item)))
{
return {};
}
if (pItem->IsRunOnTick()) if (pItem->IsRunOnTick())
{ {
if (!AuTryInsert(this->items.onTickReceivers, AuConstReference(item))) if (!AuTryInsert(this->items.onTickReceivers, AuConstReference(item)))
{ {
SysPushErrorMem(); SysPushErrorMemory();
return {}; return {};
} }
} }
@ -759,7 +762,7 @@ namespace Aurora::IO
{ {
if (!AuTryInsert(this->items.onOtherReceivers, AuConstReference(item))) if (!AuTryInsert(this->items.onOtherReceivers, AuConstReference(item)))
{ {
SysPushErrorMem(); SysPushErrorMemory();
return {}; return {};
} }
} }