summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-02 19:08:54 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-02 19:08:54 +0000
commit13805a61dfe72b4ed668940ba3a5a18f12f0529c (patch)
tree3e47dc07b3b7062698e66dcf169cf49822c91aa9
parent0d0f98accbb35d600280d8b10428e63cd7a6b3f9 (diff)
downloadchromium_src-13805a61dfe72b4ed668940ba3a5a18f12f0529c.zip
chromium_src-13805a61dfe72b4ed668940ba3a5a18f12f0529c.tar.gz
chromium_src-13805a61dfe72b4ed668940ba3a5a18f12f0529c.tar.bz2
Move the NULLing out of WebViewImpl::delegate_ until after we close the page.
This allows us to receive notifications like when the V8 context is destroyed. BUG=12686 TEST=no Review URL: http://codereview.chromium.org/150186 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19828 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/webview_impl.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
index 1220f7a..ea18c4a 100644
--- a/webkit/glue/webview_impl.cc
+++ b/webkit/glue/webview_impl.cc
@@ -906,10 +906,6 @@ bool WebViewImpl::ShouldClose() {
}
void WebViewImpl::Close() {
- // Do this first to prevent reentrant notifications from being sent to the
- // initiator of the close.
- delegate_ = NULL;
-
if (page_.get()) {
// Initiate shutdown for the entire frameset. This will cause a lot of
// notifications to be sent.
@@ -922,6 +918,10 @@ void WebViewImpl::Close() {
if (devtools_agent_.get())
devtools_agent_.reset(NULL);
+ // Reset the delegate to prevent notifications being sent as we're being
+ // deleted.
+ delegate_ = NULL;
+
Release(); // Balances AddRef from WebView::Create
}