diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 22:06:10 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 22:06:10 +0000 |
commit | 9be096ebf44c2d685335bf78ddde018ea4a50cb0 (patch) | |
tree | d37e8bebe56321650ff87ebd8c365ab3f5bb7da3 /chrome/browser/dom_ui | |
parent | dd94f2f28165c2f2a72c82c0872255d881d5d052 (diff) | |
download | chromium_src-9be096ebf44c2d685335bf78ddde018ea4a50cb0.zip chromium_src-9be096ebf44c2d685335bf78ddde018ea4a50cb0.tar.gz chromium_src-9be096ebf44c2d685335bf78ddde018ea4a50cb0.tar.bz2 |
Don't delete the DOM UI property for the callback when the DOM UI is torn down.
With my ownership changes, the TabContents owns the RVHManager which owns the
DOMUI. This means that the DOM UI is deleted from ~TabContents and it will
crash during destruction if we access the TabContents to delete the property.
Review URL: http://codereview.chromium.org/92042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14253 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r-- | chrome/browser/dom_ui/html_dialog_ui.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/dom_ui/html_dialog_ui.cc b/chrome/browser/dom_ui/html_dialog_ui.cc index ab86040d..4062438 100644 --- a/chrome/browser/dom_ui/html_dialog_ui.cc +++ b/chrome/browser/dom_ui/html_dialog_ui.cc @@ -13,8 +13,14 @@ HtmlDialogUI::HtmlDialogUI(WebContents* web_contents) : DOMUI(web_contents) { } HtmlDialogUI::~HtmlDialogUI() { - // Make sure we can't get any more callbacks. - GetPropertyAccessor().DeleteProperty(web_contents()->property_bag()); + // Don't unregister our property. During the teardown of the TabContents, + // this will be deleted, but the TabContents will already be destroyed. + // + // This object is owned indirectly by the TabContents. DOMUIs can change, so + // it's scary if this DOMUI is changed out and replaced with something else, + // since the property will still point to the old delegate. But the delegate + // is itself the owner of the TabContents for a dialog so will be in scope, + // and the HTML dialogs won't swap DOMUIs anyway since they don't navigate. } // static |