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

Unified Diff: ppapi/proxy/plugin_globals.cc

Issue 11740016: PPAPI: Fix destructor ordering problem for main-thread message loop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops, loop is sometimes NULL Created 7 years, 12 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 | ppapi/proxy/ppb_message_loop_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_globals.cc
diff --git a/ppapi/proxy/plugin_globals.cc b/ppapi/proxy/plugin_globals.cc
index 1106a75b5616febf09446d485fed84faf442cc18..2913aa23eb0330685e011332f8f128dcab25656d 100644
--- a/ppapi/proxy/plugin_globals.cc
+++ b/ppapi/proxy/plugin_globals.cc
@@ -76,6 +76,13 @@ PluginGlobals::PluginGlobals(ForTest for_test)
PluginGlobals::~PluginGlobals() {
DCHECK(plugin_globals_ == this || !plugin_globals_);
+ // Release the main-thread message loop. We should have the last reference
+ // count, so this will delete the MessageLoop resource. We do this before
+ // we clear plugin_globals_, because the Resource destructor tries to access
+ // this PluginGlobals.
+ DCHECK(!loop_for_main_thread_ || loop_for_main_thread_->HasOneRef());
+ loop_for_main_thread_ = NULL;
+
plugin_globals_ = NULL;
}
« no previous file with comments | « no previous file | ppapi/proxy/ppb_message_loop_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698