Game Development Community

Crash on quit

by Steve Lamperti · in Torque Game Engine · 01/07/2004 (10:23 am) · 0 replies

I'm getting a crash in the Mac version of my Torque project, that I really have no idea how to debug. It crashes in TextureManager::freeTexture when I close the engine, with an access fault exception message. Actually the crash is not in freeTexture, but rather in glDeleteTextures, when it is trying to delete "./client/ui/chatHudBorderArray". The chatHudBorderArray texture seems to show up fine when the project is running.

The project is compiled on OS X.3 using codewarrior 8.3. If anyone has seen a similar problem, or has any suggestions as to what may be happening, or things I might try to fix the problem, I would appreciate hearing about them.

Thanks,
-Steve Lamperti

void TextureManager::freeTexture(TextureObject *to)
{
#ifdef GATHER_METRICS
   AssertFatal(to->textureSpace <= smTextureSpaceLoaded, "Error, that shouldn't happen!");
   smTextureSpaceLoaded -= to->textureSpace;
#endif

   if((gDGLRender || sgResurrect) && to->texGLName)
      glDeleteTextures(1, (const GLuint*)&to->texGLName);
   if((gDGLRender || sgResurrect) && to->smallTexGLName)
      glDeleteTextures(1, (const GLuint*)&to->smallTexGLName);

   delete to->bitmap;
   TextureDictionary::remove(to);
   delete to;
}