Skip to content

Commit

Permalink
Fix crash when changing layers between editable/non-editable layers
Browse files Browse the repository at this point in the history
Fixes #54802
Fixes #52334
Fixes #49235
  • Loading branch information
nyalldawson committed Oct 3, 2023
1 parent 52df647 commit a173de5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -15163,7 +15163,10 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
if ( !isEditable && mMapCanvas && mMapCanvas->mapTool()
&& ( mMapCanvas->mapTool()->flags() & QgsMapTool::EditTool ) && !mSaveRollbackInProgress )
{
mMapCanvas->setMapTool( mNonEditMapTool );
if ( mNonEditMapTool )
mMapCanvas->setMapTool( mNonEditMapTool );
else
mMapCanvas->setMapTool( mMapTools->mapTool( QgsAppMapTools::Pan ) );
}

if ( dprovider )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.h
Expand Up @@ -2448,7 +2448,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QgsMapToolsDigitizingTechniqueManager *mDigitizingTechniqueManager = nullptr;
std::unique_ptr< QgsAppMapTools > mMapTools;

QgsMapTool *mNonEditMapTool = nullptr;
QPointer< QgsMapTool > mNonEditMapTool;

QgsTaskManagerStatusBarWidget *mTaskManagerWidget = nullptr;

Expand Down

0 comments on commit a173de5

Please sign in to comment.