From 854a9043a94532841c5b8a92ab6e85f30199d2b8 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 26 Feb 2019 14:15:59 +0100 Subject: [PATCH] Delete authentication manager after destruction of the providers The providers may still have threads running that use the authentication manager and their finished signal might trigger logic in the authentication manager. --- src/core/qgsapplication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/qgsapplication.cpp b/src/core/qgsapplication.cpp index 72ad34a36b4d..27963baf2af2 100644 --- a/src/core/qgsapplication.cpp +++ b/src/core/qgsapplication.cpp @@ -1177,8 +1177,6 @@ QgsAuthManager *QgsApplication::authManager() void QgsApplication::exitQgis() { - delete QgsApplication::authManager(); - //Ensure that all remaining deleteLater QObjects are actually deleted before we exit. //This isn't strictly necessary (since we're exiting anyway) but doing so prevents a lot of //LeakSanitiser noise which hides real issues @@ -1191,6 +1189,8 @@ void QgsApplication::exitQgis() delete QgsProviderRegistry::instance(); + delete QgsApplication::authManager(); + // 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.