diff options
author | Max Kellermann <max@musicpd.org> | 2021-06-22 20:31:09 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2021-06-22 20:31:45 +0200 |
commit | 175d2c6d2936d914423271e124aa0f18185c063f (patch) | |
tree | f92dcdb550723c7a223f2103db8858e0cbf339f9 | |
parent | ab487b9a99f9438bd147e0c3a4d7467287a4c0d8 (diff) |
Main: use AtScopeExit() to call ZeroconfDeinit()
Make sure that ZeroconfDeinit() gets called even if startup fails with
an exception. Fixes an assertion failure because an Avahi TimerEvent
is still active.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1192
-rw-r--r-- | src/Main.cxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/Main.cxx b/src/Main.cxx index 9d9a3430b..1a2a94ef5 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -477,6 +477,7 @@ MainConfigured(const struct options &options, const ConfigData &raw_config) #endif ZeroconfInit(raw_config, instance.event_loop); + AtScopeExit() { ZeroconfDeinit(); }; #ifdef ENABLE_DATABASE if (create_db) { @@ -537,9 +538,6 @@ MainConfigured(const struct options &options, const ConfigData &raw_config) instance.state_file->Write(); instance.BeginShutdownUpdate(); - - ZeroconfDeinit(); - instance.BeginShutdownPartitions(); } |