示例#1
0
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();
}
示例#2
0
MaHttp::~MaHttp()
{
	lock();
	unloadModules();
	if (user) {
		mprFree(user);
	}
	if (group) {
		mprFree(group);
	}
#if BLD_FEATURE_MULTITHREAD
	delete mutex;
#endif
}
示例#3
0
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
}
示例#4
0
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;
}
示例#5
0
ModuleManager::~ModuleManager() {
	unloadModules();
}