[gtk+] range: Don't leak pointers to discarded gadgets



commit c16a7d96b87efdffbbc0aeb9e6166ae5b7e80fa8
Author: Benjamin Otte <otte redhat com>
Date:   Tue Nov 8 02:24:40 2016 +0100

    range: Don't leak pointers to discarded gadgets

 gtk/gtkrange.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index e260d7b..5b1f2dc 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -3729,6 +3729,10 @@ sync_stepper_gadget (GtkRange                *range,
     {
       if (*gadget_ptr != NULL)
         {
+          if (*gadget_ptr == priv->grab_location)
+            stop_scrolling (range);
+          if (*gadget_ptr == priv->mouse_location)
+            priv->mouse_location = NULL;
           gtk_css_node_set_parent (gtk_css_gadget_get_node (*gadget_ptr), NULL);
           gtk_box_gadget_remove_gadget (GTK_BOX_GADGET (priv->contents_gadget), *gadget_ptr);
         }


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