Game Development Community

need help with T2DSceneContainer Crash

by Raymond Ku · in Torque X 2D · 02/21/2011 (8:10 pm) · 0 replies

I need ideas on how to go about debugging my crash.
I am getting a nullreferenceexception when my code unloads my levels and resets. The Scene object that is causing the crash seems to be a template item and the game is crashing when the clone template is being registered.

As I am not sure what scenecontainer is actually doing, i can only assume that i am somehow unloading my level incorrectly and have left something behind in memory.

I have tried to unload the scene, and then do a search of TorqueObjectDatabase for all registered objects and mark any remaining objects for delete.

Do i need to somehow delete my scenegraph as well (i noticed that the scene container is a private variable in T2DScenegraph)?

I should note i have two consecutive txscenes loaded and this crash only occurs on restart of the same level.

below is the call stack if it can shed any light to my problem.
If anyone can provide some feedback, it would be greatly appreciated.
I'm a bit at a lost.

Thanks


  • GarageGames.TorqueX.Framework.dll!GarageGames.Torque.SceneGraph.SceneContainer._AddSceneObjectDirect(GarageGames.Torque.SceneGraph.ISceneContainerObject obj, uint minX, uint minY, uint maxX, uint maxY) + 0xa4 bytes
  • GarageGames.TorqueX.Framework.dll!GarageGames.Torque.SceneGraph.SceneContainer._CheckSceneObjectBins(GarageGames.Torque.SceneGraph.ISceneContainerObject obj, GarageGames.Torque.SceneGraph.SceneContainerData scd, uint minBinX, uint minBinY, uint maxBinX, uint maxBinY) + 0x73 bytes
  • GarageGames.TorqueX.Framework2D.dll!GarageGames.Torque.T2D.T2DSceneContainer.CheckSceneObjectBinsT2D(GarageGames.Torque.T2D.T2DSceneObject obj) Line 162 + 0xd bytes C#
  • GarageGames.TorqueX.Framework2D.dll!GarageGames.Torque.T2D.T2DSceneGraph.UpdateObjectT2D(GarageGames.Torque.T2D.T2DSceneObject obj) Line 246 + 0xc bytes C#
  • GarageGames.TorqueX.Framework2D.dll!GarageGames.Torque.T2D.T2DSceneObject.UpdateSpatialData() Line 1065 + 0xc bytes C#
  • GarageGames.TorqueX.Framework2D.dll!GarageGames.Torque.T2D.T2DSceneObject.Size.set(Microsoft.Xna.Framework.Vector2 value) Line 203 + 0x6 bytes C#
  • GarageGames.TorqueX.Framework2D.dll!GarageGames.Torque.T2D.T2DSceneObject.CopyTo(GarageGames.Torque.Core.TorqueObject obj) Line 1452 + 0xc bytes C#
  • GarageGames.TorqueX.Framework.dll!GarageGames.Torque.Core.TorqueObject.Clone() + 0x199 bytes