Can't add new SimObjectPtr to GameConnection
by Noah Dyer · in Torque Game Engine · 04/03/2006 (12:15 pm) · 3 replies
My game requires that the user be able to control two objects simultaneously, the player and a GameBase object. But I'm getting stopped in my tracks fairly early on.
In GameConnection.h I added the following line after the declaration of mControlObject (I'm not in front of my dev machine right now, so forgive me if I make any capitilization or similar errors):
Any ideas why my additions would be causing this error. I did a search for SimObjectPtr and SimObjectPtr looking for similar problems, but came up empty handed. I also made the same changes on a clean build and had the same problem, so I don't think its anything I've done to the Engine.
In GameConnection.h I added the following line after the declaration of mControlObject (I'm not in front of my dev machine right now, so forgive me if I make any capitilization or similar errors):
SimObjectPtr<GameBase> mControl2;Then in gameConnection.cc I added the following in the GameConnection constructor
mControl2 = NULL;I've not exposed the variable to script, I've not assigned it a value anywhere, and I've not created any methods that use it. However, when I run the engine it crashes even before the GG splash screen is shown. It says the error is in netstringtable and reads "error ref count is already 0".
Any ideas why my additions would be causing this error. I did a search for SimObjectPtr and SimObjectPtr
#2
are you sure it's not something else ?
try getting rid of mControl2 and seeing if it runs.
mAimObject is a SimObjectPtr, implemented as you describe.
04/04/2006 (12:06 pm)
Hmm, that should work fine.are you sure it's not something else ?
try getting rid of mControl2 and seeing if it runs.
mAimObject is a SimObjectPtr
#3
04/04/2006 (2:42 pm)
When I comment out the two lines containing mControl2 it compiles and runs fine. Also, I get the same crash if I change GameBase to ShapeBase. I looked at the call stack in the debugger, and it looks like the last thing GameConnection related that is still on the stack when the crash occurs is the the destructor.
Torque Owner Noah Dyer