mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-09-29 18:47:38 +00:00
Plug a leak
A type class reference gotten with g_type_class_ref must be released with g_type_class_unref, or else we leak.
This commit is contained in:
parent
32001ec638
commit
4dc47c3714
@ -145,6 +145,7 @@ static gboolean
|
||||
widget_needs_widget_path (GtkWidget *widget)
|
||||
{
|
||||
static GetPathForChildFunc funcs[2];
|
||||
GtkContainerClass *class;
|
||||
GtkWidget *parent;
|
||||
GetPathForChildFunc parent_func;
|
||||
guint i;
|
||||
@ -152,8 +153,14 @@ widget_needs_widget_path (GtkWidget *widget)
|
||||
if (G_UNLIKELY (funcs[0] == NULL))
|
||||
{
|
||||
i = 0;
|
||||
funcs[i++] = GTK_CONTAINER_CLASS (g_type_class_ref (GTK_TYPE_CONTAINER))->get_path_for_child;
|
||||
funcs[i++] = GTK_CONTAINER_CLASS (g_type_class_ref (GTK_TYPE_BOX))->get_path_for_child;
|
||||
|
||||
class = (GtkContainerClass*)g_type_class_ref (GTK_TYPE_CONTAINER);
|
||||
funcs[i++] = class->get_path_for_child;
|
||||
g_type_class_unref (class);
|
||||
|
||||
class = (GtkContainerClass*)g_type_class_ref (GTK_TYPE_BOX);
|
||||
funcs[i++] = class->get_path_for_child;
|
||||
g_type_class_unref (class);
|
||||
|
||||
g_assert (i == G_N_ELEMENTS (funcs));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user