Instance: eliminate ShutdownDatabase(), move code to destructor
Destruct automatically, even if leaving the scope due to exception being thrown.
This commit is contained in:
14
src/Main.cxx
14
src/Main.cxx
@@ -359,19 +359,6 @@ Instance::FinishShutdownUpdate() noexcept
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void
|
||||
Instance::ShutdownDatabase() noexcept
|
||||
{
|
||||
#ifdef ENABLE_DATABASE
|
||||
if (instance->database != nullptr) {
|
||||
instance->database->Close();
|
||||
delete instance->database;
|
||||
}
|
||||
|
||||
delete instance->storage;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void
|
||||
Instance::BeginShutdownPartitions() noexcept
|
||||
{
|
||||
@@ -648,7 +635,6 @@ mpd_main_after_fork(const ConfigData &raw_config, const Config &config)
|
||||
#endif
|
||||
|
||||
instance->FinishShutdownUpdate();
|
||||
instance->ShutdownDatabase();
|
||||
|
||||
#ifdef ENABLE_SQLITE
|
||||
sticker_global_finish();
|
||||
|
Reference in New Issue
Block a user