示例#1
0
文件: program.c 项目: Feechka/UOBP
void
endProgram (void) {
  while (programExitEntries) {
    ProgramExitEntry *pxe = programExitEntries;
    programExitEntries = pxe->next;

    pxe->handler();
    free(pxe);
  }
}
示例#2
0
void
endProgram (void) {
  logMessage(LOG_DEBUG, "stopping program components");

  while (programExitEntries) {
    ProgramExitEntry *pxe = programExitEntries;
    char *name = pxe->name;

    programExitEntries = pxe->next;
    if (!name) name = "unknown";

    logMessage(LOG_DEBUG, "stopping program component: %s", name);
    pxe->handler(pxe->data);

    if (pxe->name) free(pxe->name);
    free(pxe);
  }

  logMessage(LOG_DEBUG, "stopped program components");
  popLogPrefix();
}