Skip to content

Commit

Permalink
close driver if attributes are missing
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@6293 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Dec 21, 2006
1 parent 67f32b1 commit be3ab6f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -1974,6 +1974,7 @@ std::vector<QgsFeatureAttribute> *QgsGrassProvider::attributes ( int field, int
#endif

if ( nRecords < 1 ) {
db_close_database_shutdown_driver ( driver );
std::cerr << "No DB record" << std::endl;
return att;
}
Expand All @@ -1983,6 +1984,7 @@ std::vector<QgsFeatureAttribute> *QgsGrassProvider::attributes ( int field, int

int more;
if ( db_fetch (&databaseCursor, DB_NEXT, &more) != DB_OK ) {
db_close_database_shutdown_driver ( driver );
std::cout << "Cannot fetch DB record" << std::endl;
return att;
}
Expand Down

0 comments on commit be3ab6f

Please sign in to comment.