Page 1 of 1

[Level Refactor bcc1aa95b] Eventhandler randomly disappears

PostPosted: Fri Feb 08, 2019 1:32 am
by Matt
This version of HD, which has a line added to continually log players[0].cmd.

1. Warp to Map15.
2. IDDQD.
3. Faff around for a few minutes. (EDIT: you don't even need to do anything, but it is easier to see when the bug kicks in if the logspam isn't just zero.)

Expected: the logspam just keeps going.
Actual: after a while it just stops.

It doesn't seem to be related to anything I'm doing, but it seems I can't replicate it without monsters around.

Is there some way to isolate the moment when an eventhandler is destroyed?
EDIT: And how *is* an eventhandler destroyed, other than by calling "destroy()" (which HD definitely does not do at any point)? Knowing how it might disappear would help a lot to isolate this, I suspect.



EDIT: Isolated example attached. Ran
Code: Select allExpand view
gzdoom -file ~/handlertest -warp 01 -fast -skill 4
IDCLEV15'd and ran around in the courtyard after also summoning about 50 chaingun guys, the logs stopped shortly after.

Re: [Level Refactor bcc1aa95b] Eventhandler randomly disappe

PostPosted: Fri Feb 08, 2019 2:25 am
by Graf Zahl
If you want to catch its destruction, add a Console.Printf to its OnDestroy method.
The only other way than intentional destruction is that it gets caught by the garbage collector, but even that goes through that method.

Re: [Level Refactor bcc1aa95b] Eventhandler randomly disappe

PostPosted: Fri Feb 08, 2019 2:42 am
by Matt
In that case I'm pretty sure it's the garbage collector - one way to make sure this bug kicks in is to kill at least 3 zombies with a single grenade, which spawns a huge buttload of actors and thinkers and whatnot all at once.

And it seems I can't replicate this if I use "+map map15" in the command line, only if I use "+map range" (EDIT: or "-warp 01" with the isolated sample) and then IDCLEV15. Knox reported on Discord that he got this bug when he went from map01 to map02 as well.

Re: [Level Refactor bcc1aa95b] Eventhandler randomly disappe

PostPosted: Sat Feb 09, 2019 2:53 am
by Graf Zahl
Looks to be a duplicate of this: viewtopic.php?f=2&t=63596
which perfectly explains what happens. Once that older handler gets collected it'd take the new one away with it as well.