diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-07 22:56:57 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-07 22:56:57 +0000 |
commit | ee994138f7aab9b61acf9d4ec1229bd251345c65 (patch) | |
tree | b1415a4cac32af5e448a3b9a83664542e0f229c1 /dbus | |
parent | 5e55d257e6427bf04073e0fefe0af214877b5e31 (diff) | |
download | chromium_src-ee994138f7aab9b61acf9d4ec1229bd251345c65.zip chromium_src-ee994138f7aab9b61acf9d4ec1229bd251345c65.tar.gz chromium_src-ee994138f7aab9b61acf9d4ec1229bd251345c65.tar.bz2 |
Track active references in ShillClientHelper (Take 3)
To prevent Shill Service DBus ObjectProxy instances from accumulating,
remove them when the service becomes inactive.
Hopefully includes ASAN fixes.
BUG=223483
TBR=hashimoto@chromium.org
Review URL: https://codereview.chromium.org/26289002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227371 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/bus.cc | 6 | ||||
-rw-r--r-- | dbus/object_proxy.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/dbus/bus.cc b/dbus/bus.cc index 3f8e6d7f..28257f8 100644 --- a/dbus/bus.cc +++ b/dbus/bus.cc @@ -265,13 +265,13 @@ bool Bus::RemoveObjectProxyWithOptions(const std::string& service_name, options); ObjectProxyTable::iterator iter = object_proxy_table_.find(key); if (iter != object_proxy_table_.end()) { + scoped_refptr<ObjectProxy> object_proxy = iter->second; + object_proxy_table_.erase(iter); // Object is present. Remove it now and Detach in the DBus thread. GetDBusTaskRunner()->PostTask( FROM_HERE, base::Bind(&Bus::RemoveObjectProxyInternal, - this, iter->second, callback)); - - object_proxy_table_.erase(iter); + this, object_proxy, callback)); return true; } return false; diff --git a/dbus/object_proxy.h b/dbus/object_proxy.h index b183be2..48c9c03 100644 --- a/dbus/object_proxy.h +++ b/dbus/object_proxy.h @@ -166,6 +166,8 @@ class CHROME_DBUS_EXPORT ObjectProxy // BLOCKING CALL. virtual void Detach(); + const ObjectPath& object_path() const { return object_path_; } + // Returns an empty callback that does nothing. Can be used for // CallMethod(). static ResponseCallback EmptyResponseCallback(); |