Skip to content

Commit

Permalink
Disconnect QgsMapTool::destroyed also when tool is unset via QgsMapCa…
Browse files Browse the repository at this point in the history
…nvas::unsetMapTool

Ensures consistent behaviour with when tool is replaced in QgsMapCanvas::setMapTool.
  • Loading branch information
manisandro authored and nyalldawson committed Jan 16, 2020
1 parent 0c83435 commit 4667152
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -1784,6 +1784,7 @@ void QgsMapCanvas::unsetMapTool( QgsMapTool *tool )
{
if ( mMapTool && mMapTool == tool )
{
disconnect( mMapTool, &QObject::destroyed, this, &QgsMapCanvas::mapToolDestroyed );
mMapTool->deactivate();
mMapTool = nullptr;
emit mapToolSet( nullptr, mMapTool );
Expand Down

0 comments on commit 4667152

Please sign in to comment.