Wintermute Engine Forum

Wintermute Engine => WME Lite => Topic started by: HCDaniel on March 07, 2016, 08:38:49 PM

Title: Question about CBGame::UnregisterObject
Post by: HCDaniel on March 07, 2016, 08:38:49 PM
Hi Mnemonic,

I'm experiencing the same thing that happened here: with WMElite.

Do you know whether the fix you did back then made it into WME lite?

I looked into the code and am trying to understand what happens. In my case, a window is unloaded (with Game.UnloadObject) shortly after a call to Game.SaveGame.
The crash happens shortly after load, when the Game.UnloadObject command is reached, because the window object somehow refers(?) to/is casted(?) to/contains(?) an "CScValue" object, and the "InvalidateValues" method is called, which tries to call "IsNative()", and that one crashes because "if(m_Type==VAL_VARIABLE_REF)" is true but m_ValRef is NULL for one object of the list of instances. (As far as I understand the situation.)

I have no idea how it can happen that an CScValue object can have the m_Type field set to VAL_VARIABLE_REF but no valid m_ValRef, at least after load. Can you help me out (once again)?