void endProgram (void) { while (programExitEntries) { ProgramExitEntry *pxe = programExitEntries; programExitEntries = pxe->next; pxe->handler(); free(pxe); } }
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(); }