mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-31 20:48:56 +00:00
gst-docs: drop use of GSlice in example code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3784>
This commit is contained in:
parent
18a3c32323
commit
0d9bdf238c
2 changed files with 5 additions and 5 deletions
|
@ -36,7 +36,7 @@ provided to the `gst_mini_object_init()` function.
|
||||||
MyObject *
|
MyObject *
|
||||||
my_object_new()
|
my_object_new()
|
||||||
{
|
{
|
||||||
MyObject *res = g_slice_new (MyObject);
|
MyObject *res = g_new (MyObject, 1);
|
||||||
|
|
||||||
gst_mini_object_init (GST_MINI_OBJECT_CAST (res), 0,
|
gst_mini_object_init (GST_MINI_OBJECT_CAST (res), 0,
|
||||||
MY_TYPE_OBJECT,
|
MY_TYPE_OBJECT,
|
||||||
|
@ -61,7 +61,7 @@ _my_object_free (MyObject *obj)
|
||||||
/* other cleanup */
|
/* other cleanup */
|
||||||
...
|
...
|
||||||
|
|
||||||
g_slice_free (MyObject, obj);
|
g_free (obj);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ default_push (GstTaskPool * pool, GstTaskPoolFunction func, gpointer data,
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
struct sched_param param;
|
struct sched_param param;
|
||||||
|
|
||||||
tid = g_slice_new0 (TestRTId);
|
tid = g_new0 (TestRTId, 1);
|
||||||
|
|
||||||
pthread_attr_init (&attr);
|
pthread_attr_init (&attr);
|
||||||
if ((res = pthread_attr_setschedpolicy (&attr, SCHED_RR)) != 0)
|
if ((res = pthread_attr_setschedpolicy (&attr, SCHED_RR)) != 0)
|
||||||
|
@ -146,7 +146,7 @@ default_push (GstTaskPool * pool, GstTaskPoolFunction func, gpointer data,
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
g_set_error (error, G_THREAD_ERROR, G_THREAD_ERROR_AGAIN,
|
g_set_error (error, G_THREAD_ERROR, G_THREAD_ERROR_AGAIN,
|
||||||
"Error creating thread: %s", g_strerror (res));
|
"Error creating thread: %s", g_strerror (res));
|
||||||
g_slice_free (TestRTId, tid);
|
g_free (tid);
|
||||||
tid = NULL;
|
tid = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ default_join (GstTaskPool * pool, gpointer id)
|
||||||
|
|
||||||
pthread_join (tid->thread, NULL);
|
pthread_join (tid->thread, NULL);
|
||||||
|
|
||||||
g_slice_free (TestRTId, tid);
|
g_free (tid);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue