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

Unified Diff: chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc

Issue 12210107: Fix issue 174250, crash when reloading packaged app. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: test Created 7 years, 10 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
Index: chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc
diff --git a/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc b/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc
index 506a0826d420365e0f187866ca8a233e36c4e753..3304dc82bf884b9f45b17347237bb96ef454f728 100644
--- a/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/gtk/extensions/native_app_window_gtk.h"
+#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.h"
@@ -182,12 +183,15 @@ void NativeAppWindowGtk::Close() {
// 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;
-
- // 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);
+
+ // 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().
+ MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&ShellWindow::OnNativeClose,
+ base::Unretained(shell_window_)));
}
void NativeAppWindowGtk::Activate() {

Powered by Google App Engine
This is Rietveld 408576698