Game Development Community

Atlas bug

by John Carroll · in Torque Game Engine Advanced · 03/22/2007 (4:41 pm) · 0 replies

Hi,
We've found an Atlas bug that will cause a crash on exit. There are two global variables:

RenderInstManager gRenderInstManager;
and
Vector< MatInstance * > MatInstance::mMatInstList;

The destructor of the RenderInstManager destroys a "warning material", which in turn tries to update the static mMatInstList. Since there is no guaranteed order of destruction of global variables in C++, if the compiler decides to destroy the static mMatInstList first we get a crash when trying to exit the application. (and of course, our builds always decide to do it the way that makes it crash).

I simply created a shutdown() method in RenderInstManager which deletes the warning material and I am calling it from our shutdown code.

About the author

Working on using Torque as an Image Generator for Tactical Simulations under laser and live fire conditions, for Law Enforcement/Military applications.