Skip to content

Commit

Permalink
fix: replace g_memdup with g_memdup2
Browse files Browse the repository at this point in the history
`g_memdup` is deprecated.

Ref fofix#25
  • Loading branch information
Linkid committed Mar 21, 2022
1 parent 2a7c310 commit 7fa4feb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion mixstream/MixStream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 7fa4feb

Please sign in to comment.