// Frees pakdata memory (called more often than you'd think). void freePakData( CONTROLLER *pcController ) { if( pcController && pcController->pPakData ) { P_free( pcController->pPakData ); pcController->pPakData = NULL; } }
// Frees modifier memory void freeModifiers( CONTROLLER *pcController ) { if( pcController && pcController->pModifiers ) { pcController->nModifiers = 0; P_free( pcController->pModifiers ); pcController->pModifiers = NULL; } }
// This function is called as a thread by DoShortcut in order to tell the plugin to insert a pak shortly // (usually after we've just removed whatever pak was there) DWORD WINAPI DelayedShortcut(LPVOID lpParam) { LPMSHORTCUT sc = (LPMSHORTCUT)lpParam; if (sc && sc->iShortcut != SC_SWMEMRUMB && sc->iShortcut != SC_SWMEMADAPT) // don't allow recursion into self, it would cause a deadlock { Sleep(1000); // sleep a little bit before calling DoShortcut again DoShortcut(sc->iControl, sc->iShortcut); } P_free(lpParam); return 0; }
void SS_free(SS *problem) { REFSET_free(problem->rs); P_free(problem->p); CC_IFFREE(problem->rs, REFSET); CC_IFFREE(problem->p, P); CC_IFFREE(problem->jobarray, Job *); problem->b2 = 0; problem->b1 = 0; problem->timelimit = .0; problem->njobs = 0; if (problem->random != NULL) { g_rand_free(problem->random); } }