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

Unified Diff: dbus/bus.cc

Issue 8201023: Make ExportedObject and ObjectProxy own Bus as scoped_refptr. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 2 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
« no previous file with comments | « no previous file | dbus/bus_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/bus.cc
diff --git a/dbus/bus.cc b/dbus/bus.cc
index 843739ce9e218fc7f313c6536b12995a73eed6f0..598056bf441f36afb04631e7bfd18a222fbf0005 100644
--- a/dbus/bus.cc
+++ b/dbus/bus.cc
@@ -293,6 +293,12 @@ void Bus::ShutdownAndBlock() {
iter->second->Detach();
}
+ // Release object proxies and exported objects here. We should do this
+ // here rather than in the destructor to avoid memory leaks due to
+ // cyclic references.
+ object_proxy_table_.clear();
+ exported_object_table_.clear();
+
// Private connection should be closed.
if (connection_) {
if (connection_type_ == PRIVATE)
« no previous file with comments | « no previous file | dbus/bus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698