Index: dbus/bus.cc |
diff --git a/dbus/bus.cc b/dbus/bus.cc |
index 30b6cc31cfa8f15a888deba5fd993c1175dfc045..51f67b6b1ef2fccadf8a54fa9f9f4a37192da938 100644 |
--- a/dbus/bus.cc |
+++ b/dbus/bus.cc |
@@ -235,6 +235,28 @@ ObjectProxy* Bus::GetObjectProxyWithOptions(const std::string& service_name, |
return object_proxy.get(); |
} |
+void Bus::RemoveObjectProxy(const std::string& service_name, |
+ const ObjectPath& object_path) { |
+ RemoveObjectProxyWithOptions(service_name, object_path, |
+ ObjectProxy::DEFAULT_OPTIONS); |
+} |
+ |
+void Bus::RemoveObjectProxyWithOptions(const std::string& service_name, |
+ const dbus::ObjectPath& object_path, |
+ int options) { |
+ AssertOnOriginThread(); |
+ |
+ // Check if we have the requested object proxy. |
+ const ObjectProxyTable::key_type key(service_name + object_path.value(), |
+ options); |
+ ObjectProxyTable::iterator iter = object_proxy_table_.find(key); |
+ if (iter != object_proxy_table_.end()) { |
+ // Detach and erase |
+ iter->second.get()->Detach(); |
satorux1
2013/01/18 17:32:40
You cannot all Detach() here, as Detach() should b
|
+ object_proxy_table_.erase(iter); |
+ } |
+} |
+ |
ExportedObject* Bus::GetExportedObject(const ObjectPath& object_path) { |
AssertOnOriginThread(); |