Skip to content
Permalink
Browse files

Call QgsMapTool::deactivate after clearing QgsMapCanvas::mMapTool

Ensures that QgsMapCanvas::mapTool does not return tool currently being unset.
  • Loading branch information
manisandro authored and nyalldawson committed Oct 23, 2019
1 parent ae25d61 commit c304eb5496de5d0c0451a0925ec0f50516ebd51a
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/gui/qgsmapcanvas.cpp
@@ -1785,9 +1785,9 @@ void QgsMapCanvas::unsetMapTool( QgsMapTool *tool )
if ( mMapTool && mMapTool == tool )
{
disconnect( mMapTool, &QObject::destroyed, this, &QgsMapCanvas::mapToolDestroyed );
mMapTool->deactivate();
QgsMapTool *oldTool = mMapTool;
mMapTool = nullptr;
oldTool->deactivate();
emit mapToolSet( nullptr, oldTool );
setCursor( Qt::ArrowCursor );
}

0 comments on commit c304eb5

Please sign in to comment.
You can’t perform that action at this time.