Skip to content

Commit

Permalink
Merge pull request #44349 from m-kuhn/avoid_projection_selection_recu…
Browse files Browse the repository at this point in the history
…rsion_crash

Avoid recursion in crs validation
  • Loading branch information
m-kuhn committed Jul 24, 2021
2 parents 1e3117d + 23521d2 commit c74e886
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -777,6 +777,11 @@ void QgisApp::validateCrs( QgsCoordinateReferenceSystem &srs )
// \note this class is not a descendent of QWidget so we can't pass
// it in the ctor of the layer projection selector

static bool opening = false;
if ( opening )
break;
opening = true;

QgsProjectionSelectionDialog *mySelector = new QgsProjectionSelectionDialog();
const QString validationHint = srs.validationHint();
if ( !validationHint.isEmpty() )
Expand All @@ -803,6 +808,7 @@ void QgisApp::validateCrs( QgsCoordinateReferenceSystem &srs )
}

delete mySelector;
opening = false;
break;
}

Expand Down

0 comments on commit c74e886

Please sign in to comment.