Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 Jan 16, 2020
1 parent ae25d61 commit c304eb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/qgsmapcanvas.cpp
Expand Up @@ -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 );
}
Expand Down

0 comments on commit c304eb5

Please sign in to comment.