Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: src/object.cpp

Issue 6250197: Allow explicit object registration. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/dbus-cplusplus.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« include/dbus-c++/object.h ('K') | « include/dbus-c++/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/object.cpp
diff --git a/src/object.cpp b/src/object.cpp
index f7d0916031d5c5e6c527d39c5a1cc836feb319d6..5bb538d3742b60ee50b2298413438abb5ac548f3 100644
--- a/src/object.cpp
+++ b/src/object.cpp
@@ -173,6 +173,9 @@ void ObjectAdaptor::register_obj()
void ObjectAdaptor::unregister_obj()
{
+ if (!is_registered())
+ return;
+
_adaptor_table.erase(path());
debug_log("unregistering local object %s", path().c_str());
@@ -180,6 +183,11 @@ void ObjectAdaptor::unregister_obj()
dbus_connection_unregister_object_path(conn()._pvt->conn, path().c_str());
}
+bool ObjectAdaptor::is_registered()
+{
+ return _adaptor_table.find(path()) != _adaptor_table.end();
+}
+
void ObjectAdaptor::_emit_signal(SignalMessage &sig)
{
sig.path(path().c_str());
@@ -321,6 +329,11 @@ void ObjectProxy::unregister_obj()
conn().remove_filter(_filtered);
}
+bool ObjectProxy::is_registered()
+{
+ return true;
+}
+
Message ObjectProxy::_invoke_method(CallMessage &call)
{
if (call.path() == NULL)
« include/dbus-c++/object.h ('K') | « include/dbus-c++/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698