Skip to content

Commit f6e571e

Browse files
committed
Do not open new db connection if connection is already open
1 parent 05274bf commit f6e571e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/gdsqlite.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ SQLite::~SQLite()
8989

9090
bool SQLite::open_db()
9191
{
92+
if (db) {
93+
UtilityFunctions::printerr("GDSQLite Error: Can't open database if connection is already open!");
94+
return false;
95+
}
96+
9297
char *zErrMsg = 0;
9398
int rc;
9499
if (path.find(":memory:") == -1)
@@ -180,6 +185,7 @@ bool SQLite::close_db()
180185
}
181186
}
182187

188+
UtilityFunctions::printerr("GDSQLite Error: Can't close database if connection is not open!");
183189
return false;
184190
}
185191

0 commit comments

Comments
 (0)