mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-11 22:40:17 -05:00
Perform explicit sqlite3 init/deinit
This commit is contained in:
13
src/db.c
13
src/db.c
@@ -3931,6 +3931,13 @@ db_init(void)
|
||||
|
||||
db_path = cfg_getstr(cfg_getsec(cfg, "general"), "db_path");
|
||||
|
||||
ret = sqlite3_initialize();
|
||||
if (ret != SQLITE_OK)
|
||||
{
|
||||
DPRINTF(E_FATAL, L_DB, "SQLite3 failed to initialize\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!sqlite3_threadsafe())
|
||||
{
|
||||
DPRINTF(E_FATAL, L_DB, "The SQLite3 library is not built with a threadsafe configuration\n");
|
||||
@@ -3964,3 +3971,9 @@ db_init(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
db_deinit(void)
|
||||
{
|
||||
sqlite3_shutdown();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user