Skip to content
Permalink
Browse files
Disconnect signals on unload to avoid crash when plugin has been unlo…
…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 496c294f36b914a6c357295b0d2f7718d3981538
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/plugins/grass/qgsgrassplugin.cpp
@@ -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 ) );
@@ -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

0 comments on commit 496c294

Please sign in to comment.