diff options
author | Max Kellermann <max@musicpd.org> | 2018-06-03 09:37:34 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-06-03 09:58:34 +0200 |
commit | c60b50b1ae67c4d1e7c0dfbeb3303771f2563df3 (patch) | |
tree | 138e8c63bc85cc1de78c7aa457586b4011d54945 /src/neighbor | |
parent | f3ffdaf21ff59124b154faffbad199218d7d9cc1 (diff) |
neighbor/udisks2: use SafeSingleton for managing the ODBus::Glue instance
Allows other objects to use the same single instance as well.
Diffstat (limited to 'src/neighbor')
-rw-r--r-- | src/neighbor/plugins/UdisksNeighborPlugin.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/neighbor/plugins/UdisksNeighborPlugin.cxx b/src/neighbor/plugins/UdisksNeighborPlugin.cxx index c95ce0e65..b9ce00b3e 100644 --- a/src/neighbor/plugins/UdisksNeighborPlugin.cxx +++ b/src/neighbor/plugins/UdisksNeighborPlugin.cxx @@ -32,6 +32,7 @@ #include "neighbor/Listener.hxx" #include "neighbor/Info.hxx" #include "thread/Mutex.hxx" +#include "thread/SafeSingleton.hxx" #include "util/Domain.hxx" #include "util/StringAPI.hxx" #include "util/Manual.hxx" @@ -74,7 +75,7 @@ class UdisksNeighborExplorer final EventLoop &event_loop; - Manual<ODBus::Glue> dbus_glue; + Manual<SafeSingleton<ODBus::Glue>> dbus_glue; ODBus::PendingCall pending_list_call; @@ -97,7 +98,7 @@ public: } auto &&GetConnection() noexcept { - return dbus_glue->GetConnection(); + return dbus_glue.Get()->GetConnection(); } /* virtual methods from class NeighborExplorer */ |