Took the deletion of a static pointer out of destructor.
This commit is contained in:
parent
366928ba51
commit
89e4751823
2 changed files with 15 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue