Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix Python error when unloading the OSM plugin
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14545 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty committed Nov 11, 2010
1 parent 850c6ca commit 2288b3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/plugins/osm/OsmDatabaseManager.py
Expand Up @@ -55,6 +55,12 @@ def __init__(self,plugin):
QObject.connect(QgsMapLayerRegistry.instance(),SIGNAL("layerWillBeRemoved(QString)"),self.layerRemoved)


def disconnectSignals(self):
# disconnect layer changes signals
QObject.disconnect(self.plugin.iface,SIGNAL("currentLayerChanged(QgsMapLayer*)"),self.currLayerChanged)
QObject.disconnect(QgsMapLayerRegistry.instance(),SIGNAL("layerWillBeRemoved(QString)"),self.layerRemoved)


def currLayerChanged(self,layer):
"""Function is called after currentLayerChanged(QgsMapLayer*) signal is emitted.
Expand Down
1 change: 1 addition & 0 deletions python/plugins/osm/OsmPlugin.py
Expand Up @@ -147,6 +147,7 @@ def unload(self):
"""Function unloads the OSM Plugin.
"""

self.dbm.disconnectSignals()
self.canvas.unsetMapTool(self.dockWidget.mapTool)
del self.dockWidget.mapTool
self.dockWidget.mapTool=None
Expand Down

0 comments on commit 2288b3c

Please sign in to comment.