Took the deletion of a static pointer out of destructor.

This commit is contained in:
Harry Moffat 2004-07-21 20:41:06 +00:00
parent 366928ba51
commit 89e4751823
2 changed files with 15 additions and 2 deletions

View file

@ -42,9 +42,20 @@ namespace Cantera {
return __factory;
}
static void deleteFactory() {
if (__factory) {
delete __factory;
__factory = 0;
}
}
/**
* Destructor doesn't do anything. We do not delete statically
* created single instance of this class here, because it would
* create an infinite loop if destructor is called for that
* single instance.
*/
virtual ~ThermoFactory() {
delete __factory;
__factory = 0;
}
/**

View file

@ -20,6 +20,7 @@
#include "xml.h"
#include "ctml.h"
#include "SpeciesThermoFactory.h"
#include "ThermoFactory.h"
#include "FalloffFactory.h"
//#ifndef WIN32
@ -91,6 +92,7 @@ namespace Cantera {
__app = 0;
}
SpeciesThermoFactory::deleteFactory();
ThermoFactory::deleteFactory();
FalloffFactory::deleteFalloffFactory();
Unit::deleteUnit();
}