listbase: Fix leak

We were leaking the temporary tracker here.
This commit is contained in:
Benjamin Otte 2020-06-03 17:49:04 +02:00
parent 00f2b134e3
commit aa38fc712f

View File

@ -1460,6 +1460,7 @@ gtk_list_base_grab_focus_on_item (GtkListBase *self,
{
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
GtkListItemManagerItem *item;
gboolean success;
item = gtk_list_item_manager_get_nth (priv->item_manager, pos, NULL);
if (item == NULL)
@ -1478,17 +1479,18 @@ gtk_list_base_grab_focus_on_item (GtkListBase *self,
item = gtk_list_item_manager_get_nth (priv->item_manager, pos, NULL);
g_assert (item->widget);
if (!gtk_widget_grab_focus (item->widget))
return FALSE;
success = gtk_widget_grab_focus (item->widget);
gtk_list_item_tracker_free (priv->item_manager, tracker);
}
else
{
if (!gtk_widget_grab_focus (item->widget))
return FALSE;
success = gtk_widget_grab_focus (item->widget);
}
if (!success)
return FALSE;
if (select)
gtk_list_base_select_item (self, pos, modify, extend);