[totem] main: Fix crash on exit through fullscreen object



commit 692f7ecd23f4b2ab7e79c260fc3c77e6298f19e4
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jul 13 13:02:01 2011 +0100

    main: Fix crash on exit through fullscreen object
    
    As we weren't cleaning this up properly.

 src/totem-fullscreen.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/totem-fullscreen.c b/src/totem-fullscreen.c
index 636ed32..4ab4c99 100644
--- a/src/totem-fullscreen.c
+++ b/src/totem-fullscreen.c
@@ -179,7 +179,10 @@ totem_fullscreen_window_unrealize_cb (GtkWidget *widget, TotemFullscreen *fs)
 					      G_CALLBACK (totem_fullscreen_size_changed_cb), fs);
 	g_signal_handlers_disconnect_by_func (gtk_icon_theme_get_for_screen (screen),
 					      G_CALLBACK (totem_fullscreen_theme_changed_cb), fs);
-	gtk_widget_destroy (fs->priv->osd);
+	if (fs->priv->osd != NULL) {
+		gtk_widget_destroy (fs->priv->osd);
+		fs->priv->osd = NULL;
+	}
 }
 
 static gboolean
@@ -569,6 +572,18 @@ totem_fullscreen_finalize (GObject *object)
 		fs->priv->motion_handler_id = 0;
 	}
 
+	if (fs->priv->osd != NULL) {
+		gtk_widget_destroy (fs->priv->osd);
+		fs->priv->osd = NULL;
+	}
+
+	g_signal_handlers_disconnect_by_func (fs->priv->parent_window,
+					      G_CALLBACK (totem_fullscreen_window_realize_cb),
+					      fs);
+	g_signal_handlers_disconnect_by_func (fs->priv->parent_window,
+					      G_CALLBACK (totem_fullscreen_window_unrealize_cb),
+					      fs);
+
 	G_OBJECT_CLASS (totem_fullscreen_parent_class)->finalize (object);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]