neighbor/udisks2: use SafeSingleton for managing the ODBus::Glue instance
Allows other objects to use the same single instance as well.
This commit is contained in:
		| @@ -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 */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann