mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-10 03:04:05 +02:00
gobject/tests/performance: fix leaks
Easily spotted by ASAN. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
@@ -372,5 +372,6 @@ main (int argc,
|
|||||||
run_test (&tests[i]);
|
run_test (&tests[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_option_context_free (context);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -479,7 +479,7 @@ test_construction_init (PerformanceTest *test,
|
|||||||
if (data->n_objects != n)
|
if (data->n_objects != n)
|
||||||
{
|
{
|
||||||
data->n_objects = n;
|
data->n_objects = n;
|
||||||
data->objects = g_new (GObject *, n);
|
data->objects = g_renew (GObject *, data->objects, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -603,7 +603,7 @@ test_finalization_init (PerformanceTest *test,
|
|||||||
if (data->n_objects != n)
|
if (data->n_objects != n)
|
||||||
{
|
{
|
||||||
data->n_objects = n;
|
data->n_objects = n;
|
||||||
data->objects = g_new (GObject *, n);
|
data->objects = g_renew (GObject *, data->objects, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < data->n_objects; i++)
|
for (int i = 0; i < data->n_objects; i++)
|
||||||
@@ -1219,5 +1219,6 @@ main (int argc,
|
|||||||
run_test (&tests[k]);
|
run_test (&tests[k]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_option_context_free (context);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user