Index: gfx/gtk_preserve_window.cc |
diff --git a/gfx/gtk_preserve_window.cc b/gfx/gtk_preserve_window.cc |
index c49bd31531880e1f1e13a1309701bb32c182c442..0e2b9db87fdded0ca02ff4b3969bc1daf12bb7bc 100644 |
--- a/gfx/gtk_preserve_window.cc |
+++ b/gfx/gtk_preserve_window.cc |
@@ -61,10 +61,13 @@ GtkWidget* gtk_preserve_window_new() { |
static void gtk_preserve_window_destroy(GtkObject* object) { |
GtkWidget* widget = reinterpret_cast<GtkWidget*>(object); |
+ GtkPreserveWindowPrivate* priv = GTK_PRESERVE_WINDOW_GET_PRIVATE(widget); |
if (widget->window) { |
gdk_window_set_user_data(widget->window, NULL); |
- gdk_window_destroy(widget->window); |
+ // If the window is preserved, someone else must destroy it. |
+ if (!priv->preserve_window) |
+ gdk_window_destroy(widget->window); |
widget->window = NULL; |
} |