void Controller::exitRequested() { deleteVariables(); deleteHotkeys(); Resources::tempFolder.remove(); exit(0); }
/* Very alike the copy constructor the function copies the content of the given environment into the calling environment. */ void environment::copy (const environment & e) { if (name) free (name); name = e.name ? strdup (e.name) : NULL; deleteVariables (); copyVariables (e.root); solvee = e.solvee; checkee = e.checkee; defs = e.defs; delete children; iscopy = true; children = new ptrlist<environment>; }
// Destructor deletes the environment object. environment::~environment () { if (name) free (name); deleteVariables (); // delete solver and checker if this is not just a reference if (!iscopy) { if (solvee) delete solvee; if (checkee) { checkee->setEquations (NULL); delete checkee; } } // delete children for (ptrlistiterator<environment> it (*children); *it; ++it) { delete (*it); } delete children; }
static VariableNestingLevel * getBaseDataVariables (void) { if (baseDataVariables) { releaseVariableNestingLevel(currentDataVariables); deleteVariables(baseDataVariables); } else { VariableNestingLevel *globalVariables = getGlobalVariables(1); if (!globalVariables) return NULL; VariableNestingLevel *baseVariables = newVariableNestingLevel(globalVariables, "base"); if (!baseVariables) return NULL; baseDataVariables = claimVariableNestingLevel(baseVariables); } currentDataVariables = claimVariableNestingLevel(baseDataVariables); return baseDataVariables; }
Controller::~Controller() { Resources::tempFolder.remove(); deleteVariables(); deleteHotkeys(); }