Commit 175d2c6d authored by Max Kellermann's avatar Max Kellermann

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
parent ab487b9a
......@@ -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();
}
......
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