Skip to content

Commit

Permalink
MBTiles: Close database on destruction, fixing leak and gwaldron#1738
Browse files Browse the repository at this point in the history
  • Loading branch information
emminizer committed Aug 25, 2021
1 parent 3ebbcfd commit 386980f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/osgEarth/MBTiles
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace osgEarth { namespace MBTiles
{
public:
Driver();
virtual ~Driver();

Status open(
const std::string& name,
Expand Down
7 changes: 7 additions & 0 deletions src/osgEarth/MBTiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,13 @@ MBTiles::Driver::Driver() :
//nop
}

Driver::~Driver()
{
sqlite3* database = (sqlite3*)_database;
if (database)
sqlite3_close_v2(database);
}

Status
MBTiles::Driver::open(
const std::string& name,
Expand Down

0 comments on commit 386980f

Please sign in to comment.