Skip to content
Permalink
Browse files

Fix finalize statement and close srs.db

  • Loading branch information
mhugent committed Nov 25, 2013
1 parent b756fe7 commit 392be7846b293ab0f93b80cea0810123f68733fe
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/qgscoordinatetransform.cpp
@@ -857,13 +857,15 @@ void QgsCoordinateTransform::searchDatumTransform( const QString& sql, QList< in
int openResult = sqlite3_open( QgsApplication::srsDbFilePath().toUtf8().constData(), &db );
if ( openResult != SQLITE_OK )
{
sqlite3_close( db );
return;
}

sqlite3_stmt* stmt;
int prepareRes = sqlite3_prepare( db, sql.toAscii(), sql.size(), &stmt, NULL );
if ( prepareRes != SQLITE_OK )
{
sqlite3_close( db );
return;
}

@@ -885,6 +887,7 @@ QString QgsCoordinateTransform::datumTransformString( int datumTransform )
int openResult = sqlite3_open( QgsApplication::srsDbFilePath().toUtf8().constData(), &db );
if ( openResult != SQLITE_OK )
{
sqlite3_close( db );
return transformString;
}

@@ -893,6 +896,7 @@ QString QgsCoordinateTransform::datumTransformString( int datumTransform )
int prepareRes = sqlite3_prepare( db, sql.toAscii(), sql.size(), &stmt, NULL );
if ( prepareRes != SQLITE_OK )
{
sqlite3_close( db );
return transformString;
}

@@ -925,6 +929,8 @@ QString QgsCoordinateTransform::datumTransformString( int datumTransform )
}
}

sqlite3_finalize( stmt );
sqlite3_close( db );
return transformString;
}

0 comments on commit 392be78

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