Commit da9bd46a authored by Matthias Clasen's avatar Matthias Clasen

text handle: Don't leak adjustments

This can happen if the weak pointer is triggered before the
adjustments are unset. Pointed out in

https://bugzilla.gnome.org/show_bug.cgi?id=774790
parent 6e856f62
......@@ -461,25 +461,21 @@ _gtk_text_handle_set_scrollable (GtkTextHandle *handle,
priv = handle->priv;
if (priv->parent_scrollable)
if (priv->vadj)
{
if (priv->vadj)
{
g_signal_handlers_disconnect_by_data (priv->vadj, handle);
g_object_unref (priv->vadj);
priv->vadj = NULL;
}
g_signal_handlers_disconnect_by_data (priv->vadj, handle);
g_clear_object (&priv->vadj);
}
if (priv->hadj)
{
g_signal_handlers_disconnect_by_data (priv->hadj, handle);
g_object_unref (priv->hadj);
priv->hadj = NULL;
}
g_object_remove_weak_pointer (G_OBJECT (priv->parent_scrollable), (gpointer *) &priv->parent_scrollable);
if (priv->hadj)
{
g_signal_handlers_disconnect_by_data (priv->hadj, handle);
g_clear_object (&priv->hadj);
}
if (priv->parent_scrollable)
g_object_remove_weak_pointer (G_OBJECT (priv->parent_scrollable), (gpointer *) &priv->parent_scrollable);
priv->parent_scrollable = scrollable;
if (scrollable)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment