Properly de-initialize the database engine on delete()

This commit is contained in:
Pierre Pronchery 2012-12-03 19:15:46 +01:00
parent 4b51aea95a
commit 7b0ef8d70d

View File

@ -61,7 +61,13 @@ Database * database_new(char const * engine, Config * config,
void database_delete(Database * database)
{
if(database->plugin != NULL)
{
if(database->dplugin != NULL
&& database->dplugin->destroy != NULL
&& database->database != NULL)
database->dplugin->destroy(database->database);
plugin_delete(database->plugin);
}
object_delete(database);
}