clutter: Stop using GSlice

It has been inofficially deprecated for years, is known to cause issues
with valgrind and potentially hides memory corruption.
Lets stop using it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1512>
This commit is contained in:
Robert Mader
2020-10-19 19:57:45 +02:00
parent df4508e8cf
commit 8b977e9046
21 changed files with 81 additions and 81 deletions

View File

@ -911,7 +911,7 @@ ClutterColor *
clutter_color_copy (const ClutterColor *color)
{
if (G_LIKELY (color != NULL))
return g_slice_dup (ClutterColor, color);
return g_memdup2 (color, sizeof (ClutterColor));
return NULL;
}
@ -928,7 +928,7 @@ void
clutter_color_free (ClutterColor *color)
{
if (G_LIKELY (color != NULL))
g_slice_free (ClutterColor, color);
g_free (color);
}
/**
@ -977,7 +977,7 @@ clutter_color_new (guint8 red,
ClutterColor *
clutter_color_alloc (void)
{
return g_slice_new0 (ClutterColor);
return g_new0 (ClutterColor, 1);
}
/**