Instance: eliminate FinishShutdownUpdate(), move code to destructor

This commit is contained in:
Max Kellermann 2019-02-15 18:20:11 +01:00
parent 99c23cf139
commit f70eb63879
3 changed files with 3 additions and 11 deletions

View File

@ -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()
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;

View File

@ -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;

View File

@ -351,14 +351,6 @@ Instance::BeginShutdownUpdate() noexcept
#endif #endif
} }
inline void
Instance::FinishShutdownUpdate() noexcept
{
#ifdef ENABLE_DATABASE
delete update;
#endif
}
inline void inline void
Instance::BeginShutdownPartitions() noexcept Instance::BeginShutdownPartitions() noexcept
{ {
@ -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