Skip to content

Commit

Permalink
Fix for segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jan 7, 2014
1 parent bd77ecc commit f8247fa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/providers/postgres/qgspostgresconn.cpp
Expand Up @@ -270,10 +270,11 @@ void QgsPostgresConn::disconnect()
Q_ASSERT( !key.isNull() );
connections.remove( key );

if ( QThread::currentThread() == QApplication::instance()->thread() )
deleteLater();
if ( !QApplication::instance() || QThread::currentThread() == QApplication::instance()->thread() )
deleteLater();
else
delete this;
delete this;

}

/* private */
Expand Down

0 comments on commit f8247fa

Please sign in to comment.