mirror of
https://github.com/brl/mutter.git
synced 2025-06-27 07:27:05 +00:00
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:
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user