Commit d19631dc authored by Martin Schultz's avatar Martin Schultz

added Hint to Toolbox interface documentation to point out that widgets

shall not be deleted by the plugin after they were added.

call cleanup before exit of plugins.
explicitly delete plugins after cleanup.
parent 8b1648d7
......@@ -96,6 +96,8 @@ class ToolboxInterface {
/** \brief Add a toolbox widget to the gui with the given name
*
* This signal adds a toolbox widget to the toolbox area on the right.
* Hint: Ownership of the widget is expected to be transferred with this signal.
* Do not delete the widget in your plugins destructor.
*
* @param _name Visible name of the toolbox
* @param _widget Pointer to the toolbox widget
......@@ -105,6 +107,8 @@ class ToolboxInterface {
/** \brief Add a toolbox widget to the gui with the given name and an icon
*
* This signal adds a toolbox widget to the toolbox area on the right. And sets an icon for it
* Hint: Ownership of the widget is expected to be transferred with this signal.
* Do not delete the widget in your plugins destructor.
*
* @param _name Visible name of the toolbox
* @param _widget Pointer to the toolbox widget
......@@ -115,6 +119,8 @@ class ToolboxInterface {
/** \brief Add a toolbox widget to the gui with the given name, icon and header area widget.
*
* This signal adds a toolbox widget to the toolbox area on the right. And sets an icon for it
* Hint: Ownership of the widget is expected to be transferred with this signal.
* Do not delete the widget in your plugins destructor.
*
* @param _name Visible name of the toolbox
* @param _widget Pointer to the toolbox widget
......
......@@ -1159,6 +1159,10 @@ void Core::slotExit() {
// Write all information on application exit
writeOnExit();
// Call clearAll() before closing application
// in order to call all object's destructors...
clearAll();
// Notify plugins of imminent exit.
for ( uint i = 0 ; i < plugins_.size() ; ++i ){
BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugins_[i].plugin);
......@@ -1168,9 +1172,9 @@ void Core::slotExit() {
basePlugin->exit();
}
// Call clearAll() before closing application
// in order to call all object's destructors...
clearAll();
// Delete Plugins to actually call their destructor
for(PluginInfo p : plugins_)
delete p.plugin;
// close the log file to ensure everything is writeen correctly
if (logFile_)
......
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