Skip to content

Commit 392be78

Browse files
committedNov 25, 2013
Fix finalize statement and close srs.db
1 parent b756fe7 commit 392be78

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/core/qgscoordinatetransform.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,13 +857,15 @@ void QgsCoordinateTransform::searchDatumTransform( const QString& sql, QList< in
857857
int openResult = sqlite3_open( QgsApplication::srsDbFilePath().toUtf8().constData(), &db );
858858
if ( openResult != SQLITE_OK )
859859
{
860+
sqlite3_close( db );
860861
return;
861862
}
862863

863864
sqlite3_stmt* stmt;
864865
int prepareRes = sqlite3_prepare( db, sql.toAscii(), sql.size(), &stmt, NULL );
865866
if ( prepareRes != SQLITE_OK )
866867
{
868+
sqlite3_close( db );
867869
return;
868870
}
869871

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

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

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

932+
sqlite3_finalize( stmt );
933+
sqlite3_close( db );
928934
return transformString;
929935
}
930936

0 commit comments

Comments
 (0)
Please sign in to comment.