Skip to content

Commit

Permalink
Merge pull request #7151 from rouault/fix_use_after_free_at_qgis_exit
Browse files Browse the repository at this point in the history
Fix use-after-free at QGIS exist, linked to QgsCoordinateTransform cache
  • Loading branch information
rouault committed Jun 3, 2018
2 parents 164f662 + 6b7504d commit 851319f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/qgsapplication.cpp
Expand Up @@ -1084,6 +1084,11 @@ void QgsApplication::exitQgis()

delete QgsProviderRegistry::instance();

// invalidate coordinate cache while the PROJ context held by the thread-locale
// QgsProjContextStore object is still alive. Otherwise if this later object
// is destroyed before the static variables of the cache, we might use freed memory.
QgsCoordinateTransform::invalidateCache();

// tear-down GDAL/OGR
OGRCleanupAll();
GDALDestroyDriverManager();
Expand Down

0 comments on commit 851319f

Please sign in to comment.