From 7fa4feb470974879131c78a6c2f684e2619b998c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Magimel?= Date: Mon, 21 Mar 2022 22:07:29 +0100 Subject: [PATCH] fix: replace `g_memdup` with `g_memdup2` `g_memdup` is deprecated. Ref #25 --- CHANGELOG.md | 1 + mixstream/MixStream.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8356b0d..4157a17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - fix: remove `g_thread_init` (deprecation) ([#26](https://github.com/fofix/python-mixstream/pull/26)) - fix: replace `GStaticMutex` with `GMutex` (deprecation) ([#24](https://github.com/fofix/python-mixstream/pull/24)) +- fix: replace `g_memdup` with `g_memdup2` (deprecation) ([#30](https://github.com/fofix/python-mixstream/pull/30)) - fix: replace `g_mutex_free` with `g_mutex_clear` to free resources (deprecation) ([#29](https://github.com/fofix/python-mixstream/pull/29)) - fix: replace `g_mutex_new` with `g_mutex_init` to init a mutex (deprecation) ([#28](https://github.com/fofix/python-mixstream/pull/28)) diff --git a/mixstream/MixStream.c b/mixstream/MixStream.c index c3346b1..3abda19 100644 --- a/mixstream/MixStream.c +++ b/mixstream/MixStream.c @@ -352,7 +352,7 @@ int mix_stream_play(MixStream* stream, int requested_channel) /* Now we know what channel we're on. Put it into the channel table. */ g_mutex_lock(&chan_table_mutex); stream->channel = real_channel; - g_hash_table_insert(chan_table, g_memdup(&stream->channel, sizeof(int)), stream); + g_hash_table_insert(chan_table, g_memdup2(&stream->channel, sizeof(int)), stream); g_mutex_unlock(&chan_table_mutex); stream->chunk_start_ticks = SDL_GetTicks();