From f8817a8e8d1789d56452804c28fd47a787cf6682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 24 Jan 2023 20:21:40 +0000 Subject: [PATCH] ges: nle: drop use of GSlice allocator Part-of: --- .../plugins/nle/nlecomposition.c | 16 ++++++++-------- .../plugins/nle/nleghostpad.c | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/subprojects/gst-editing-services/plugins/nle/nlecomposition.c b/subprojects/gst-editing-services/plugins/nle/nlecomposition.c index b3541ac574..d0a5795ca1 100644 --- a/subprojects/gst-editing-services/plugins/nle/nlecomposition.c +++ b/subprojects/gst-editing-services/plugins/nle/nlecomposition.c @@ -785,7 +785,7 @@ _remove_object_func (NleComposition * comp, ChildIOData * childio) static void _add_remove_object_action (NleComposition * comp, NleObject * object) { - ChildIOData *childio = g_slice_new0 (ChildIOData); + ChildIOData *childio = g_new0 (ChildIOData, 1); GST_DEBUG_OBJECT (comp, "Adding Action"); @@ -835,7 +835,7 @@ _add_object_func (NleComposition * comp, ChildIOData * childio) static void _add_add_object_action (NleComposition * comp, NleObject * object) { - ChildIOData *childio = g_slice_new0 (ChildIOData); + ChildIOData *childio = g_new0 (ChildIOData, 1); GST_DEBUG_OBJECT (comp, "Adding Action"); @@ -855,18 +855,18 @@ _free_action (gpointer udata, Action * action) SeekData *seekd = (SeekData *) udata; gst_event_unref (seekd->event); - g_slice_free (SeekData, seekd); + g_free (seekd); } else if (ACTION_CALLBACK (action) == _add_object_func) { ChildIOData *iodata = (ChildIOData *) udata; gst_object_unref (iodata->object); - g_slice_free (ChildIOData, iodata); + g_free (iodata); } else if (ACTION_CALLBACK (action) == _remove_object_func) { - g_slice_free (ChildIOData, udata); + g_free (udata); } else if (ACTION_CALLBACK (action) == _update_pipeline_func || ACTION_CALLBACK (action) == _commit_func || ACTION_CALLBACK (action) == _initialize_stack_func) { - g_slice_free (UpdateCompositionData, udata); + g_free (udata); } } @@ -911,7 +911,7 @@ _add_action (NleComposition * comp, GCallback func, static SeekData * create_seek_data (NleComposition * comp, GstEvent * event) { - SeekData *seekd = g_slice_new0 (SeekData); + SeekData *seekd = g_new0 (SeekData, 1); seekd->comp = comp; seekd->event = event; @@ -993,7 +993,7 @@ static void _add_update_compo_action (NleComposition * comp, GCallback callback, NleUpdateStackReason reason) { - UpdateCompositionData *ucompo = g_slice_new0 (UpdateCompositionData); + UpdateCompositionData *ucompo = g_new0 (UpdateCompositionData, 1); ucompo->comp = comp; ucompo->reason = reason; diff --git a/subprojects/gst-editing-services/plugins/nle/nleghostpad.c b/subprojects/gst-editing-services/plugins/nle/nleghostpad.c index cb1e5ec24d..eeefdc0997 100644 --- a/subprojects/gst-editing-services/plugins/nle/nleghostpad.c +++ b/subprojects/gst-editing-services/plugins/nle/nleghostpad.c @@ -589,7 +589,7 @@ ghostpad_query_function (GstPad * ghostpad, GstObject * parent, static void internal_pad_finalizing (NlePadPrivate * priv, GObject * pad G_GNUC_UNUSED) { - g_slice_free (NlePadPrivate, priv); + g_free (priv); } static inline GstPad * @@ -630,7 +630,7 @@ control_internal_pad (GstPad * ghostpad, NleObject * object) if (G_UNLIKELY (!(priv = gst_pad_get_element_private (internal)))) { GST_DEBUG_OBJECT (internal, "Creating a NlePadPrivate to put in element_private"); - priv = g_slice_new0 (NlePadPrivate); + priv = g_new0 (NlePadPrivate, 1); /* Remember existing pad functions */ priv->eventfunc = GST_PAD_EVENTFUNC (internal); @@ -729,7 +729,7 @@ nle_object_ghost_pad_no_target (NleObject * object, const gchar * name, /* remember the existing ghostpad event/query/link/unlink functions */ - priv = g_slice_new0 (NlePadPrivate); + priv = g_new0 (NlePadPrivate, 1); priv->dir = dir; priv->object = object; @@ -763,7 +763,7 @@ nle_object_remove_ghost_pad (NleObject * object, GstPad * ghost) gst_ghost_pad_set_target (GST_GHOST_PAD (ghost), NULL); gst_element_remove_pad (GST_ELEMENT (object), ghost); if (priv) - g_slice_free (NlePadPrivate, priv); + g_free (priv); } gboolean