Commit 4f2724ca authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Improved exit signal handling.


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@19636 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f33afc88
......@@ -305,7 +305,7 @@ class BaseInterface {
/** @} */
private slots :
public slots :
/** This function is called when the application exits or when your plugin is about to be unloaded.
* Here you can clean up your plugin, delete local variables...
......
......@@ -706,14 +706,6 @@ Core::init() {
Core::~Core()
{
for ( uint i = 0 ; i < plugins_.size() ; ++i ){
BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugins_[i].plugin);
// Dont call exit if we cannot get the Plugin
if ( basePlugin )
if ( checkSlot( plugins_[i].plugin , "exit()" ) )
QMetaObject::invokeMethod(plugins_[i].plugin, "exit", Qt::DirectConnection);
}
// Delete the objectRoot if it was constructed
if ( objectRoot_ != 0 ) {
......@@ -1160,13 +1152,6 @@ Core::writeOnExit() {
windowStates.endGroup ();
}
// Call exit for all plugins
for (uint i = 0 ; i < plugins_.size() ; ++i) {
BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugins_[i].plugin);
if ( basePlugin )
if ( checkSlot( plugins_[i].plugin , "exit()" ) )
QMetaObject::invokeMethod(plugins_[i].plugin, "exit", Qt::DirectConnection);
}
}
//-----------------------------------------------------------------------------
......@@ -1175,6 +1160,15 @@ void Core::slotExit() {
// Write all information on application exit
writeOnExit();
// Notify plugins of imminent exit.
for ( uint i = 0 ; i < plugins_.size() ; ++i ){
BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugins_[i].plugin);
// Dont call exit if we cannot get the Plugin
if ( basePlugin )
basePlugin->exit();
}
// Call clearAll() before closing application
// in order to call all object's destructors...
clearAll();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment