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@7967 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jan 15, 2008
1 parent 609760a commit 7c6eb96b7dc264380ad9e0468b43ebdada783516
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 7c6eb96

Please sign in to comment.