[Xfce4-commits] <xfce4-panel:xfce-4.8> Keep reference on window to avoid crash (bug #7193).

Nick Schermer noreply at xfce.org
Fri Feb 25 21:08:09 CET 2011


Updating branch refs/heads/xfce-4.8
         to 81957d1f009f8125b49ef8c2864328f7d0245467 (commit)
       from 4f0a7722c76be4daa2d10ecb9296a6fcfed36ed1 (commit)

commit 81957d1f009f8125b49ef8c2864328f7d0245467
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Feb 19 17:39:57 2011 +0100

    Keep reference on window to avoid crash (bug #7193).

 plugins/tasklist/tasklist-widget.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index 15ff7bf..81cf744 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -2597,6 +2597,8 @@ xfce_tasklist_button_enter_notify_event_disconnected (gpointer  data,
    * proxy dies */
   g_signal_handlers_disconnect_by_func (child->window,
       xfce_tasklist_button_geometry_changed, child);
+
+  g_object_unref (G_OBJECT (child->window));
 }
 
 
@@ -2614,6 +2616,7 @@ xfce_tasklist_button_proxy_menu_item (XfceTasklistChild *child,
   panel_return_val_if_fail (child->type == CHILD_TYPE_OVERFLOW_MENU
                             || child->type == CHILD_TYPE_GROUP_MENU, NULL);
   panel_return_val_if_fail (GTK_IS_LABEL (child->label), NULL);
+  panel_return_val_if_fail (WNCK_IS_WINDOW (child->window), NULL);
 
   mi = gtk_image_menu_item_new ();
   exo_binding_new (G_OBJECT (child->label), "label", G_OBJECT (mi), "label");
@@ -2635,6 +2638,7 @@ xfce_tasklist_button_proxy_menu_item (XfceTasklistChild *child,
 
   if (allow_wireframe)
     {
+      g_object_ref (G_OBJECT (child->window));
       g_signal_connect_data (G_OBJECT (mi), "enter-notify-event",
           G_CALLBACK (xfce_tasklist_button_enter_notify_event), child,
           xfce_tasklist_button_enter_notify_event_disconnected, 0);



More information about the Xfce4-commits mailing list