Skip to content

Commit 0ff6341

Browse files
committed
fix crash in Dxf2Shp plugin
1 parent fbf8225 commit 0ff6341

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

src/plugins/dxf2shp_converter/dxf2shpconverter.cpp

+18-14
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ void dxf2shpConverter::unload()
115115
mQGisIface->removePluginVectorMenu( tr( "&Dxf2Shp" ), mQActionPointer );
116116
mQGisIface->removeVectorToolBarIcon( mQActionPointer );
117117
delete mQActionPointer;
118+
mQActionPointer = 0;
118119
}
119120

120121
void dxf2shpConverter::addMyLayer( QString myfname, QString mytitle )
@@ -129,21 +130,24 @@ void dxf2shpConverter::setCurrentTheme( QString theThemeName )
129130
QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/dxf2shp_converter.png";
130131
QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/dxf2shp_converter.png";
131132
QString myQrcPath = ":/dxf2shp_converter.png";
132-
if ( QFile::exists( myCurThemePath ) )
133+
if ( mQActionPointer )
133134
{
134-
mQActionPointer->setIcon( QIcon( myCurThemePath ) );
135-
}
136-
else if ( QFile::exists( myDefThemePath ) )
137-
{
138-
mQActionPointer->setIcon( QIcon( myDefThemePath ) );
139-
}
140-
else if ( QFile::exists( myQrcPath ) )
141-
{
142-
mQActionPointer->setIcon( QIcon( myQrcPath ) );
143-
}
144-
else
145-
{
146-
mQActionPointer->setIcon( QIcon() );
135+
if ( QFile::exists( myCurThemePath ) )
136+
{
137+
mQActionPointer->setIcon( QIcon( myCurThemePath ) );
138+
}
139+
else if ( QFile::exists( myDefThemePath ) )
140+
{
141+
mQActionPointer->setIcon( QIcon( myDefThemePath ) );
142+
}
143+
else if ( QFile::exists( myQrcPath ) )
144+
{
145+
mQActionPointer->setIcon( QIcon( myQrcPath ) );
146+
}
147+
else
148+
{
149+
mQActionPointer->setIcon( QIcon() );
150+
}
147151
}
148152
}
149153

0 commit comments

Comments
 (0)