void skipFreeList(skipList list) { skipFlushDeleted(list, TRUE); /* flush deleted items */ skipFreeAllItems(list); /* free list items */ if(list->threaded) { cDestroy(&list->flush); cDestroy(&list->resume); mDestroy(&list->write); mDestroy(&list->read); } free(list->tail); /* free list */ free(list->header); free(list->deleted); free(list); return; }
// ------------------------------------------------------------------------------------------------ int TProblemManager::FreeProblemLibrary() { if (mProblem) mDestroy(mProblem); if (mLibHandle) FreeLibHandler(); mLibHandle = NULL; mProblem = NULL; mCreate = NULL; mDestroy = NULL; return TProblemManager::OK_; }
int pluginLoader::destroy(pluginInterface *instance){ if(mPlugin == NULL){ #if _DEBUG_LEVEL >= 1 std::cerr << "plugin not loaded!" << std::endl; #endif return -1; } for(unsigned int i = 0; i < mInstances.size(); i++){ if(instance == mInstances[i]) mInstances.erase(mInstances.begin() + i); //use hashmap } mDestroy(instance); instance = NULL; return 0; }
pluginLoader::~pluginLoader(){ if(mPlugin == NULL){ #if _DEBUG_LEVEL >= 1 std::cerr << "plugin not loaded!" << std::endl; #endif return; } while(mInstances.size() > 0){ mDestroy(mInstances[0]); mInstances.erase(mInstances.begin()); } dlclose(mPlugin); mPlugin = NULL; mCreate = NULL; mDestroy = NULL; }