Game Development Community

Is constructTSShape leaking?

by Neo Binedell · in Torque Game Engine Advanced · 06/21/2005 (9:00 pm) · 1 replies

As I have not delved into the memory manager or garbage collection the following shouts at me

ResourceInstance *constructTSShape(Stream &stream)
{
   TSShape * ret = new TSShape;
   if (ret->read(&stream))
      return ret;
   else
      return NULL;  // <---- IF WE GET HERE ret IS NEVER REFERENCED AGAIN AND SO IS LOST?
}

I've looked in the both TSShape and ResourceInstance constructors and I don't see any register(this) kinda stuff so what gives?

Is operator new() overloaded to auto track allocations and delete them or some other magik?

Am I just being paranoid and missing something?

Perhaps one of you can enlighten me...

regards
neo

#1
08/24/2005 (11:23 am)
Yup, definitely a bug. Fixed in 1.4. #292.