[4.13] Random crash with Canvas, maybe

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.
dpJudas
 
 
Posts: 3130
Joined: Sat May 28, 2016 1:01 pm

Re: [4.13] Random crash with Canvas, maybe

Post by dpJudas »

No, Canvas is a collection of engine managed objects. One for each canvas texture in the map.

If I read the Destroy function correctly (been some days ago I looked at it - could be wrong), OnDestroy is called before it marks it for destruction so as long as it doesn't get further everything is still in a sane state.
User avatar
Rachael
Posts: 13780
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: [4.13] Random crash with Canvas, maybe

Post by Rachael »

Then done with I_Error, this can be closed as suggested.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49177
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [4.13] Random crash with Canvas, maybe

Post by Graf Zahl »

The canvas management is one big mess.
They are held in a static array that is never cleared, so they only get collected when the object system is shut down and the scripted OnDestroy method not called anymore. Should anything change here the error will be thrown in the regular destruction process.

This will also cause problems with the 'restart' CCMD, which should clear the AllCanvases array.
dpJudas
 
 
Posts: 3130
Joined: Sat May 28, 2016 1:01 pm

Re: [4.13] Random crash with Canvas, maybe

Post by dpJudas »

The lifetime of the canvases is tied to the lifetime of textures/textureids in the texture manager. The code was written under the assumption that the texture manager's texture list is static. If 'restart' reinitializes the texture manager then it should indeed need to be cleared at that point.

About changed OnDestroyed behavior in the engine, then yes throwing an exception here will break, but then what alternative is there really?
User avatar
Rachael
Posts: 13780
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: [4.13] Random crash with Canvas, maybe

Post by Rachael »

Are there any global variables that reliably track the engine's "I'm-not-reading-script-code" state that can be used in this case to allow OnDestroy to function as normal?

Would adding the function override to the Canvas class in ZScript as a "final" instead be a viable alternative?

Return to “Closed Bugs [GZDoom]”