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
This commit is contained in:
parent
ab487b9a99
commit
175d2c6d29
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue