From dcd8bc5c69ee2d90d77ff0c8cf5c64fed7047e2a Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Tue, 7 Jan 2014 11:03:02 +0100 Subject: [PATCH] fix crash in mapserver (introduced with 1215d0b01) --- src/providers/postgres/qgspostgresconn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/postgres/qgspostgresconn.cpp b/src/providers/postgres/qgspostgresconn.cpp index 7290137aaed..cdf7e20e4c7 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;