Skip to content

Commit

Permalink
Disconnect signals on unload to avoid crash when plugin has been unlo…
Browse files Browse the repository at this point in the history
…aded.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7967 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jan 15, 2008
1 parent ee2874e commit 496c294
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/plugins/grass/qgsgrassplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void QgsGrassPlugin::initGui()
setEditAction();
connect ( qGisInterface, SIGNAL(currentLayerChanged(QgsMapLayer *)),
this, SLOT(setEditAction()) );

// Init Region symbology
mRegionPen.setColor( QColor ( settings.readEntry ("/GRASS/region/color", "#ff0000" ) ) );
mRegionPen.setWidth( settings.readNumEntry ("/GRASS/region/width", 0 ) );
Expand Down Expand Up @@ -823,6 +823,15 @@ void QgsGrassPlugin::unload()

if ( toolBarPointer )
delete toolBarPointer;

// disconnect slots of QgsGrassPlugin so they're not fired also after unload
disconnect( mCanvas, SIGNAL(renderComplete(QPainter *)), this, SLOT(postRender(QPainter *)));
disconnect ( qGisInterface, SIGNAL(currentLayerChanged(QgsMapLayer *)),
this, SLOT(setEditAction()) );

QWidget* qgis = qGisInterface->getMainWindow();
disconnect( qgis, SIGNAL( projectRead() ), this, SLOT( projectRead()));
disconnect( qgis, SIGNAL( newProject() ), this, SLOT(newProject()));
}
/**
* Required extern functions needed for every plugin
Expand Down

0 comments on commit 496c294

Please sign in to comment.