Commit f70eb638 authored by Max Kellermann's avatar Max Kellermann

Instance: eliminate FinishShutdownUpdate(), move code to destructor

parent 99c23cf1
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#ifdef ENABLE_DATABASE #ifdef ENABLE_DATABASE
#include "db/DatabaseError.hxx" #include "db/DatabaseError.hxx"
#include "db/Interface.hxx" #include "db/Interface.hxx"
#include "db/update/Service.hxx"
#include "storage/StorageInterface.hxx" #include "storage/StorageInterface.hxx"
#ifdef ENABLE_SQLITE #ifdef ENABLE_SQLITE
...@@ -53,6 +54,8 @@ Instance::Instance() ...@@ -53,6 +54,8 @@ Instance::Instance()
Instance::~Instance() noexcept Instance::~Instance() noexcept
{ {
#ifdef ENABLE_DATABASE #ifdef ENABLE_DATABASE
delete update;
if (database != nullptr) { if (database != nullptr) {
database->Close(); database->Close();
delete database; delete database;
......
...@@ -167,7 +167,6 @@ struct Instance final ...@@ -167,7 +167,6 @@ struct Instance final
#endif #endif
void BeginShutdownUpdate() noexcept; void BeginShutdownUpdate() noexcept;
void FinishShutdownUpdate() noexcept;
#ifdef ENABLE_CURL #ifdef ENABLE_CURL
void LookupRemoteTag(const char *uri) noexcept; void LookupRemoteTag(const char *uri) noexcept;
......
...@@ -352,14 +352,6 @@ Instance::BeginShutdownUpdate() noexcept ...@@ -352,14 +352,6 @@ Instance::BeginShutdownUpdate() noexcept
} }
inline void inline void
Instance::FinishShutdownUpdate() noexcept
{
#ifdef ENABLE_DATABASE
delete update;
#endif
}
inline void
Instance::BeginShutdownPartitions() noexcept Instance::BeginShutdownPartitions() noexcept
{ {
for (auto &partition : partitions) { for (auto &partition : partitions) {
...@@ -634,8 +626,6 @@ mpd_main_after_fork(const ConfigData &raw_config, const Config &config) ...@@ -634,8 +626,6 @@ mpd_main_after_fork(const ConfigData &raw_config, const Config &config)
} }
#endif #endif
instance->FinishShutdownUpdate();
#ifdef ENABLE_SQLITE #ifdef ENABLE_SQLITE
sticker_global_finish(); sticker_global_finish();
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment