Skip to content

Commit f277a84

Browse files
wonder-sktimlinux
authored andcommitted
Fix #4266 - georeferencer and spatial query crashing on exit
1 parent 871173d commit f277a84

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/plugins/georeferencer/qgsgeorefplugin.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ static const QString sPluginIcon = ":/icons/mGeorefRun.png";
8282
*/
8383
QgsGeorefPlugin::QgsGeorefPlugin( QgisInterface * theQgisInterface ):
8484
QgisPlugin( sName, sDescription, sPluginVersion, sPluginType ),
85-
mQGisIface( theQgisInterface )
85+
mQGisIface( theQgisInterface ),
86+
mPluginGui( NULL )
8687
{
8788
}
8889

@@ -117,8 +118,8 @@ void QgsGeorefPlugin::initGui()
117118
// Slot called when the buffer menu item is triggered
118119
void QgsGeorefPlugin::run()
119120
{
120-
mPluginGui = new QgsGeorefPluginGui( mQGisIface, mQGisIface->mainWindow() );
121-
mPluginGui->setAttribute( Qt::WA_DeleteOnClose );
121+
if ( !mPluginGui )
122+
mPluginGui = new QgsGeorefPluginGui( mQGisIface, mQGisIface->mainWindow() );
122123
mPluginGui->show();
123124
mPluginGui->setFocus();
124125
}
@@ -133,6 +134,9 @@ void QgsGeorefPlugin::unload()
133134

134135
delete mActionRunGeoref;
135136
delete mActionAbout;
137+
138+
delete mPluginGui;
139+
mPluginGui = NULL;
136140
}
137141

138142
//! Set icons to the current theme

src/plugins/spatialquery/qgsspatialqueryplugin.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ void QgsSpatialQueryPlugin::unload()
100100

101101
delete mSpatialQueryAction;
102102

103+
delete mDialog;
104+
mDialog = NULL;
103105
}
104106

105107
void QgsSpatialQueryPlugin::run()

0 commit comments

Comments
 (0)