Skip to content
Permalink
Browse files

Fix double-release of postgresql connection on table retriveal stop

Also breaks earlier out of loop and print a different status
message on "stop" (rather than "complete").

Fixes #14140
  • Loading branch information
Sandro Santilli
Sandro Santilli committed Jan 19, 2016
1 parent 014b696 commit 69cb0c4ed3174946c82e32dad4af5a12275079fc
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/providers/postgres/qgscolumntypethread.cpp
@@ -39,8 +39,6 @@ void QgsGeomColumnTypeThread::stop()
return;

mConn->cancel();
QgsPostgresConnPool::instance()->releaseConnection( mConn );
mConn = nullptr;
mStopped = true;
}

@@ -103,14 +101,15 @@ void QgsGeomColumnTypeThread::run()
{
layerProperty.types.clear();
layerProperty.srids.clear();
break;
}

// Now tell the layer list dialog box...
emit setLayerType( layerProperty );
}

emit progress( 0, 0 );
emit progressMessage( tr( "Table retrieval finished." ) );
emit progressMessage( mStopped ? tr( "Table retrieval stopped." ) : tr( "Table retrieval finished." ) );

QgsPostgresConnPool::instance()->releaseConnection( mConn );
mConn = nullptr;

0 comments on commit 69cb0c4

Please sign in to comment.
You can’t perform that action at this time.