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

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

Issue 20243003: Fix crash when reloading packaged app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to after mac app shim fix Created 7 years, 4 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 | « chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 41548348631785edfc6cae66b59ef5669edf26ad..0d88fcc3b3a7caf3e4127ed57c115b853e62b5e4 100644
--- a/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc
@@ -7,6 +7,7 @@
#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"
@@ -243,12 +244,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().
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&ShellWindow::OnNativeClose,
+ base::Unretained(shell_window_)));
}
void NativeAppWindowGtk::Activate() {
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698