summaryrefslogtreecommitdiff
path: root/src/Main.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-02-24 06:35:52 +0100
committerMax Kellermann <max@musicpd.org>2021-02-24 15:09:10 +0100
commit2d8ecd561b2baa62d2f5b0604f51309321df8fed (patch)
treeb71ba0485c6ef8bd032afb579857666b649f8418 /src/Main.cxx
parent2059195ae9f6884a08b29049b086d2e562b7bb11 (diff)
zeroconf: return a publisher object
Diffstat (limited to 'src/Main.cxx')
-rw-r--r--src/Main.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index 66a4c08e1..1b99ce736 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -476,12 +476,15 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
};
#endif
+#ifdef HAVE_ZEROCONF
+ std::unique_ptr<ZeroconfHelper> zeroconf;
try {
- ZeroconfInit(raw_config, instance.event_loop);
+ zeroconf = ZeroconfInit(raw_config, instance.event_loop);
} catch (...) {
LogError(std::current_exception(),
"Zeroconf initialization failed");
}
+#endif
#ifdef ENABLE_DATABASE
if (create_db) {
@@ -543,7 +546,9 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
instance.BeginShutdownUpdate();
- ZeroconfDeinit();
+#ifdef HAVE_ZEROCONF
+ zeroconf.reset();
+#endif
instance.BeginShutdownPartitions();
}