Skip to content

Commit 851319f

Browse files
authored
Merge pull request #7151 from rouault/fix_use_after_free_at_qgis_exit
Fix use-after-free at QGIS exist, linked to QgsCoordinateTransform cache
2 parents 164f662 + 6b7504d commit 851319f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/core/qgsapplication.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,11 @@ void QgsApplication::exitQgis()
10841084

10851085
delete QgsProviderRegistry::instance();
10861086

1087+
// invalidate coordinate cache while the PROJ context held by the thread-locale
1088+
// QgsProjContextStore object is still alive. Otherwise if this later object
1089+
// is destroyed before the static variables of the cache, we might use freed memory.
1090+
QgsCoordinateTransform::invalidateCache();
1091+
10871092
// tear-down GDAL/OGR
10881093
OGRCleanupAll();
10891094
GDALDestroyDriverManager();

0 commit comments

Comments
 (0)