Skip to content
Permalink
Browse files

cleanup postgres column thread

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11501 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Aug 25, 2009
1 parent 42be35e commit 2afe44984229833ea81987b4308be53c6e745c38
Showing with 10 additions and 4 deletions.
  1. +10 −4 src/app/qgsdbsourceselect.cpp
@@ -211,6 +211,14 @@ void QgsDbSourceSelect::setLayerType( QString schema,
QgsDbSourceSelect::~QgsDbSourceSelect()
{
PQfinish( pd );

if ( mColumnTypeThread )
{
mColumnTypeThread->stop();
mColumnTypeThread->wait();
delete mColumnTypeThread;
mColumnTypeThread = NULL;
}
}

void QgsDbSourceSelect::populateConnectionList()
@@ -844,7 +852,7 @@ void QgsGeomColumnTypeThread::getLayerTypes()
{
PQsetClientEncoding( pd, QString( "UNICODE" ).toLocal8Bit() );

for ( uint i = 0; i < schemas.size(); i++ )
for ( uint i = 0; i < schemas.size() && !mStopped; i++ )
{
QString query = QString( "select distinct "
"case"
@@ -871,12 +879,10 @@ void QgsGeomColumnTypeThread::getLayerTypes()
}
PQclear( gresult );

if ( mStopped )
break;

// Now tell the layer list dialog box...
emit setLayerType( schemas[i], tables[i], columns[i], type );
}

}

PQfinish( pd );

0 comments on commit 2afe449

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