Index: trunk/src/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc |
=================================================================== |
--- trunk/src/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc (revision 215781) |
+++ trunk/src/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc (working copy) |
@@ -7,7 +7,6 @@ |
#include <gdk/gdkx.h> |
#include <vector> |
-#include "base/message_loop/message_loop.h" |
#include "base/message_loop/message_pump_gtk.h" |
#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/profiles/profile.h" |
@@ -244,15 +243,12 @@ |
// To help catch bugs in any event handlers that might get fired during the |
// destruction, set window_ to NULL before any handlers will run. |
window_ = NULL; |
- gtk_widget_destroy(window); |
- // On other platforms, the native window doesn't get destroyed synchronously. |
- // We simulate that here so that ShellWindow can assume that it doesn't get |
- // deleted immediately upon calling Close(). |
- base::MessageLoop::current()->PostTask( |
- FROM_HERE, |
- base::Bind(&ShellWindow::OnNativeClose, |
- base::Unretained(shell_window_))); |
+ // OnNativeClose does a delete this so no other members should |
+ // be accessed after. gtk_widget_destroy is safe (and must |
+ // be last). |
+ shell_window_->OnNativeClose(); |
+ gtk_widget_destroy(window); |
} |
void NativeAppWindowGtk::Activate() { |