mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-16 15:14:17 +00:00
listbase: Fix leak
We were leaking the temporary tracker here.
This commit is contained in:
parent
00f2b134e3
commit
aa38fc712f
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user