Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 committed Jan 19, 2016
1 parent 014b696 commit 69cb0c4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/providers/postgres/qgscolumntypethread.cpp
Expand Up @@ -39,8 +39,6 @@ void QgsGeomColumnTypeThread::stop()
return;

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

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 69cb0c4

Please sign in to comment.