Skip to content

Commit 3896c73

Browse files
committed
fix crash in Compass plugin
1 parent 37a20f4 commit 3896c73

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/plugins/compass/qgscompassplugin.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,21 @@ void QgsCompassPlugin::unload()
145145
mQGisIface->removePluginMenu( sName, mActionAboutCompass );
146146

147147
delete mActionRunCompass;
148+
mActionRunCompass = 0;
148149
delete mActionAboutCompass;
150+
mActionAboutCompass = 0;
149151
delete mDock;
152+
mDock = 0;
150153
}
151154

152155
//! Set icons to the current theme
153156
void QgsCompassPlugin::setCurrentTheme( QString )
154157
{
155-
mActionRunCompass->setIcon( getThemeIcon( "/mCompassRun.png" ) );
156-
mActionAboutCompass->setIcon( getThemeIcon( "/mActionAbout.png" ) );
158+
if ( mActionRunCompass && mActionAboutCompass )
159+
{
160+
mActionRunCompass->setIcon( getThemeIcon( "/mCompassRun.png" ) );
161+
mActionAboutCompass->setIcon( getThemeIcon( "/mActionAbout.png" ) );
162+
}
157163
}
158164

159165
QIcon QgsCompassPlugin::getThemeIcon( const QString &theName )

0 commit comments

Comments
 (0)