Stop a crash that can happen during shutdown.

This commit is contained in:
JoelKatz
2013-01-14 02:12:03 -08:00
parent 5fa43cc770
commit 61c07696a7
2 changed files with 5 additions and 1 deletions

View File

@@ -86,11 +86,13 @@ public:
class Instance
{
protected:
static bool running;
InstanceType& mType;
public:
Instance(InstanceType& t) : mType(t) { mType.addInstance(); }
~Instance() { mType.decInstance(); }
~Instance() { if (running) mType.decInstance(); }
static void shutdown() { running = false; }
};
#endif