Skip to content

Commit

Permalink
fix Python error when unloading the OSM plugin
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@14545 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty committed Nov 11, 2010
1 parent 404d0ae commit 1372985
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 1372985

Please sign in to comment.