mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 14:01:45 +00:00
- fixed potentially missing event handlers
Event handlers linked list might skip an entry if its order was in a middle of existing handlers https://forum.zdoom.org/viewtopic.php?t=63258
This commit is contained in:
parent
295dd326da
commit
c6866bad4d
1 changed files with 5 additions and 0 deletions
|
@ -75,6 +75,11 @@ bool E_RegisterHandler(DStaticEventHandler* handler)
|
||||||
{
|
{
|
||||||
// if before is not null, link it before the existing handler.
|
// if before is not null, link it before the existing handler.
|
||||||
// note that before can be first handler, check for this.
|
// note that before can be first handler, check for this.
|
||||||
|
if (before->prev != nullptr)
|
||||||
|
{
|
||||||
|
before->prev->next = handler;
|
||||||
|
GC::WriteBarrier(before->prev, handler);
|
||||||
|
}
|
||||||
handler->next = before;
|
handler->next = before;
|
||||||
GC::WriteBarrier(handler, before);
|
GC::WriteBarrier(handler, before);
|
||||||
handler->prev = before->prev;
|
handler->prev = before->prev;
|
||||||
|
|
Loading…
Reference in a new issue