[3.7.x]EventHandler registering bug

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

[3.7.x]EventHandler registering bug

Post by Major Cooke »

Load the following files from first to last:
  1. test.pk3
  2. test2.pk3
  3. test3.pk3
Then type into console (doesn't matter what the message is, so long as it provokes NetworkProcess):

Code: Select all

netevent t
You will notice how Handler2 does not show up.

The handler orders are:
  • Handler1: 9
  • Handler2: 7
  • Handler3: 11
  • Handler4: 6
Now, if these are all together in one single PK3, all four of them are registered. However, when they're apart, this bug surfaces.
Attachments
test.pk3
(433 Bytes) Downloaded 24 times
test2.pk3
(415 Bytes) Downloaded 24 times
test3.pk3
(417 Bytes) Downloaded 24 times
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: [3.7.x]EventHandler registering bug

Post by _mental_ »

The fix involves linked lists and garbage collection, so I decided to make this PR.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [3.7.x]EventHandler registering bug

Post by Graf Zahl »

_mental_ wrote:linked lists and garbage collection[/url].

Two things that constantly seem to be at odds with each other - the main reason why I avoid using linked lists with objects in new code.
The PR looks ok but I'll wait for someone to confirm that it works.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: [3.7.x]EventHandler registering bug

Post by Major Cooke »

I did some more testing with those three samples, and then I tested it in my mod series where the bug originally happened. Mental's solution fixes the issue entirely.
Post Reply

Return to “Closed Bugs [GZDoom]”