Fatal assertion in DEBUG mode
by Adam Johnston · in Torque Game Builder · 03/30/2006 (2:41 pm) · 2 replies
Hi there
I'm trying to implement a new class in C++
I was following the tutorial in TDN:
In release mode it was working so so (it's logic bugged)
when I changed to Debug mode the engine thrown a
fatal assertion in PlatformMemory.cc::1038
So I suspect something is wrong with my class.
I was thinking maybe delete is being called even if there are no object initialized?
Any ideas?
Thank you.
I'm trying to implement a new class in C++
I was following the tutorial in TDN:
class t2dMyClass : public SimObject
{
typedef SimObject Parent;
public:
t2dMyClass ();
bool onAdd();
void onRemove();
DECLARE_CONOBJECT(t2dMyClass);
const char* generate (const S32 difficulty);
~t2dMyClass();
private:
};In release mode it was working so so (it's logic bugged)
when I changed to Debug mode the engine thrown a
fatal assertion in PlatformMemory.cc::1038
static void free(void* mem, bool array)
{
...
AssertFatal(((bool)((hdr->flags & Array)==Array))==array, avar("Array alloc mismatch. "));
}So I suspect something is wrong with my class.
I was thinking maybe delete is being called even if there are no object initialized?
Any ideas?
Thank you.
#2
I noticed I have new and delete code inside my class.
Also the destructor is being called at the start of the program
before any code, so I think is something performed by the macross of Torque.
and my destructor is deleting buffers that aren't allocated.
03/30/2006 (3:35 pm)
Exactly Michael, thank youI noticed I have new and delete code inside my class.
Also the destructor is being called at the start of the program
before any code, so I think is something performed by the macross of Torque.
and my destructor is deleting buffers that aren't allocated.
Torque Owner Michael Woerister
and than deallocated with delete x; instead of delete [] x;
-Michael