[Fixed] [3.7.x]EventHandler registering bug

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

[3.7.x]EventHandler registering bug

Postby Major Cooke » Sun Jan 13, 2019 11:42 am

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 allExpand view
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 8 times
test2.pk3
(415 Bytes) Downloaded 8 times
test3.pk3
(417 Bytes) Downloaded 8 times
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: [3.7.x]EventHandler registering bug

Postby _mental_ » Tue Jan 15, 2019 9:25 am

The fix involves linked lists and garbage collection, so I decided to make this PR.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: [3.7.x]EventHandler registering bug

Postby Graf Zahl » Tue Jan 15, 2019 9:55 am

_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
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [3.7.x]EventHandler registering bug

Postby Major Cooke » Tue Jan 15, 2019 11:46 am

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.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 2 guests