summaryrefslogtreecommitdiff
path: root/gtk/gtkrange.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-11-08 02:24:40 +0100
committerBenjamin Otte <otte@redhat.com>2016-11-08 02:25:45 +0100
commitdbc0337498e384730036c21dd2249ab5d3800b09 (patch)
tree939008e96455deeec0be54d06e83ba786a32edce /gtk/gtkrange.c
parent96e7fbde2e3d919d784b3000237d979fb81386a5 (diff)
downloadgtk+-dbc0337498e384730036c21dd2249ab5d3800b09.tar.gz
range: Don't leak pointers to discarded gadgets
Diffstat (limited to 'gtk/gtkrange.c')
-rw-r--r--gtk/gtkrange.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 30075c3426..e176bfccd5 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -3972,6 +3972,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);
}