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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 113906: Fix a deleted memory read with the infobars (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 16872)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -313,21 +313,25 @@
window->CloseConstrainedWindow();
}
+ // Notify any observer that have a reference on this tab contents.
+ NotificationService::current()->Notify(
+ NotificationType::TAB_CONTENTS_DESTROYED,
+ Source<TabContents>(this),
+ NotificationService::NoDetails());
+
// Notify any lasting InfobarDelegates that have not yet been removed that
// whatever infobar they were handling in this TabContents has closed,
// because the TabContents is going away entirely.
+ // This must happen after the TAB_CONTENTS_DESTROYED notification as the
+ // notification may trigger infobars calls that access their delegate. (and
+ // some implementations of InfoBarDelegate do delete themselves on
+ // InfoBarClosed()).
for (int i = 0; i < infobar_delegate_count(); ++i) {
InfoBarDelegate* delegate = GetInfoBarDelegateAt(i);
delegate->InfoBarClosed();
}
infobar_delegates_.clear();
- // Notify any observer that have a reference on this tab contents.
- NotificationService::current()->Notify(
- NotificationType::TAB_CONTENTS_DESTROYED,
- Source<TabContents>(this),
- NotificationService::NoDetails());
-
// TODO(brettw) this should be moved to the view.
#if defined(OS_WIN)
// If we still have a window handle, destroy it. GetNativeView can return
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698