ModuleRegistry::~ModuleRegistry() { // The modules map might be non-empty if the app is failing during very // early startup stages, and unloadModules() might not have been called yet. // Some modules might need to call this instance during their own destruction, // so it's better not to rely on the shared_ptr to destruct them. unloadModules(); }
MaHttp::~MaHttp() { lock(); unloadModules(); if (user) { mprFree(user); } if (group) { mprFree(group); } #if BLD_FEATURE_MULTITHREAD delete mutex; #endif }
PythonModules::~PythonModules() { qDebug() << "Destroying " << this; unloadModules(); PyEval_RestoreThread(pymainstate); cleaningPyObjs(); Py_Finalize(); #if defined(Q_OS_WIN) && !defined(BUILD_PYTHON_3) // this value is only used for the Python 2.7 module delete [] pythonPath; #endif //Q_OS_WIN && !BUILD_PYTHON_3 }
void ModuleRegistry::shutdownModules() { if (_modulesShutdown) { throw std::logic_error("ModuleRegistry: shutdownModules called twice."); } for (ModulesMap::value_type& pair : _initialisedModules) { pair.second->shutdownModule(); } // Fire the signal before unloading the modules _sigAllModulesUninitialised.emit(); // Free all the shared ptrs unloadModules(); _modulesShutdown = true; }
ModuleManager::~ModuleManager() { unloadModules(); }