예제 #1
0
void Controller::exitRequested()
{
  deleteVariables();
  deleteHotkeys();
  Resources::tempFolder.remove();
  exit(0);
}
예제 #2
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>;
}
예제 #3
0
// 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;
}
예제 #4
0
파일: datafile.c 프로젝트: brltty/brltty
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;
}
예제 #5
0
Controller::~Controller()
{
  Resources::tempFolder.remove();
  deleteVariables();
  deleteHotkeys();
}