Created
January 7, 2014 10:01
-
-
Save jef-n/8297212 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/providers/postgres/qgspostgresconn.cpp b/src/providers/postgres/qgspostgresconn.cpp | |
index 7290137..cdf7e20 100644 | |
--- a/src/providers/postgres/qgspostgresconn.cpp | |
+++ b/src/providers/postgres/qgspostgresconn.cpp | |
@@ -270,7 +270,7 @@ void QgsPostgresConn::disconnect() | |
Q_ASSERT( !key.isNull() ); | |
connections.remove( key ); | |
- if ( QThread::currentThread() == QApplication::instance()->thread() ) | |
+ if ( !QApplication::instance() || QThread::currentThread() == QApplication::instance()->thread() ) | |
deleteLater(); | |
else | |
delete this; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment