Skip to content

Commit 0e976f4

Browse files
slarosatimlinux
authored andcommitted
fix crash in SPIT plugin
1 parent 86ea4f3 commit 0e976f4

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

src/plugins/spit/qgsspitplugin.cpp

+18-14
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ void QgsSpitPlugin::unload()
9393
qI->removeDatabaseToolBarIcon( spitAction );
9494
qI->removePluginDatabaseMenu( tr( "&Spit" ), spitAction );
9595
delete spitAction;
96+
spitAction = 0;
9697
}
9798

9899
//! Set icons to the current theme
@@ -102,21 +103,24 @@ void QgsSpitPlugin::setCurrentTheme( QString theThemeName )
102103
QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/spit.png";
103104
QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/spit.png";
104105
QString myQrcPath = ":/spit.png";
105-
if ( QFile::exists( myCurThemePath ) )
106+
if ( spitAction )
106107
{
107-
spitAction->setIcon( QIcon( myCurThemePath ) );
108-
}
109-
else if ( QFile::exists( myDefThemePath ) )
110-
{
111-
spitAction->setIcon( QIcon( myDefThemePath ) );
112-
}
113-
else if ( QFile::exists( myQrcPath ) )
114-
{
115-
spitAction->setIcon( QIcon( myQrcPath ) );
116-
}
117-
else
118-
{
119-
spitAction->setIcon( QIcon() );
108+
if ( QFile::exists( myCurThemePath ) )
109+
{
110+
spitAction->setIcon( QIcon( myCurThemePath ) );
111+
}
112+
else if ( QFile::exists( myDefThemePath ) )
113+
{
114+
spitAction->setIcon( QIcon( myDefThemePath ) );
115+
}
116+
else if ( QFile::exists( myQrcPath ) )
117+
{
118+
spitAction->setIcon( QIcon( myQrcPath ) );
119+
}
120+
else
121+
{
122+
spitAction->setIcon( QIcon() );
123+
}
120124
}
121125
}
122126

0 commit comments

Comments
 (0)