[gtk/dnd-gestures-2: 85/173] popover: Use g_signal_connect_object on parent widget signal



commit dbb3727b0375e4aeb57e054c526f35420ebf46e6
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jan 5 20:17:38 2020 +0100

    popover: Use g_signal_connect_object on parent widget signal
    
    The popover may be destroyed, leaving this dangling signal. This
    may cause crashes on future parent widget resizes.

 gtk/gtkpopover.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index bcda0fdd50..a963b35110 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -1482,7 +1482,8 @@ gtk_popover_set_relative_to (GtkPopover *popover,
 
   if (priv->relative_to)
     {
-      g_signal_connect (priv->relative_to, "size-allocate", G_CALLBACK (size_changed), popover);
+      g_signal_connect_object (priv->relative_to, "size-allocate",
+                               G_CALLBACK (size_changed), popover, 0);
       gtk_css_node_set_parent (gtk_widget_get_css_node (GTK_WIDGET (popover)),
                                gtk_widget_get_css_node (relative_to));
       gtk_widget_set_parent (GTK_WIDGET (popover), relative_to);


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