netsim: drop use of GSlice

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
This commit is contained in:
Tim-Philipp Müller 2023-01-08 18:47:24 +00:00 committed by GStreamer Marge Bot
parent 20e6735d20
commit 80e882d266

View file

@ -216,7 +216,7 @@ typedef struct
static inline PushBufferCtx * static inline PushBufferCtx *
push_buffer_ctx_new (GstPad * pad, GstBuffer * buf) push_buffer_ctx_new (GstPad * pad, GstBuffer * buf)
{ {
PushBufferCtx *ctx = g_slice_new (PushBufferCtx); PushBufferCtx *ctx = g_new (PushBufferCtx, 1);
ctx->pad = gst_object_ref (pad); ctx->pad = gst_object_ref (pad);
ctx->buf = gst_buffer_ref (buf); ctx->buf = gst_buffer_ref (buf);
return ctx; return ctx;
@ -228,7 +228,7 @@ push_buffer_ctx_free (PushBufferCtx * ctx)
if (G_LIKELY (ctx != NULL)) { if (G_LIKELY (ctx != NULL)) {
gst_buffer_unref (ctx->buf); gst_buffer_unref (ctx->buf);
gst_object_unref (ctx->pad); gst_object_unref (ctx->pad);
g_slice_free (PushBufferCtx, ctx); g_free (ctx);
} }
} }