globle intBool DeallocateEnvironmentData() { #if ALLOW_ENVIRONMENT_GLOBALS struct environmentData *theEnvironment, *nextEnvironment; int i, rv = TRUE; for (i = 0; i < SIZE_ENVIRONMENT_HASH; i++) { for (theEnvironment = EnvironmentHashTable[i]; theEnvironment != NULL; ) { nextEnvironment = theEnvironment->next; if (! DestroyEnvironment(theEnvironment)) { rv = FALSE; } theEnvironment = nextEnvironment; } } free(EnvironmentHashTable); return(rv); #else return(FALSE); #endif }
int main( int argc, char *argv[]) { mainEnv = CreateEnvironment(); RerouteStdin(mainEnv,argc,argv); #if UNIX_V || LINUX || DARWIN || UNIX_7 || WIN_GCC || WIN_MVC signal(SIGINT,CatchCtrlC); #endif CommandLoop(mainEnv); #if UNIX_V || LINUX || DARWIN || UNIX_7 || WIN_GCC || WIN_MVC signal(SIGINT,CatchCtrlC); #endif /*==================================================================*/ /* Control does not normally return from the CommandLoop function. */ /* However if you are embedding CLIPS, have replaced CommandLoop */ /* with your own embedded calls that will return to this point, and */ /* are running software that helps detect memory leaks, you need to */ /* add function calls here to deallocate memory still being used by */ /* CLIPS. If you have a multi-threaded application, no environments */ /* can be currently executing. */ /*==================================================================*/ DestroyEnvironment(mainEnv); return(-1); }
AdventureEngineEngine::~AdventureEngineEngine() { debug("AdventureEngineEngine::~AdventureEngineEngine"); DestroyEnvironment(clipsEnv); // Dispose your resources here delete _rnd; delete _console; }
void __declspec(dllexport) CALL_CONV __DestroyEnvironment( void *theEnv) { DestroyEnvironment(theEnv); }