diff options
author | Ole André Vadla Ravnås <oleavr@gmail.com> | 2021-05-13 00:28:53 +0200 |
---|---|---|
committer | Olivier Crête <olivier.crete@ocrete.ca> | 2021-11-22 21:53:08 +0000 |
commit | e53f16c550c155976e895cbd656e622a273cc494 (patch) | |
tree | 5db05c617484cfd088b9888ffd88eee648786325 | |
parent | 389e7ab7ed571c420b2047cd1b7dc81804d547a2 (diff) | |
download | libnice-e53f16c550c155976e895cbd656e622a273cc494.tar.gz |
test-io-stream-common: Fix GSource callback signature
Cannot pass g_main_loop_quit as the GSourceFunc as its return type is
void.
-rw-r--r-- | tests/test-io-stream-common.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test-io-stream-common.c b/tests/test-io-stream-common.c index 4833261..b3c12e6 100644 --- a/tests/test-io-stream-common.c +++ b/tests/test-io-stream-common.c @@ -583,11 +583,21 @@ check_for_termination (TestIOStreamThreadData *data, gsize *recv_count, g_main_loop_quit (data->error_loop); } +static gboolean +stop_main_loop_when_idle (gpointer data) +{ + GMainLoop *loop = data; + + g_main_loop_quit (loop); + + return G_SOURCE_REMOVE; +} + void stop_main_loop (GMainLoop *loop) { GSource *src = g_idle_source_new (); - g_source_set_callback (src, G_SOURCE_FUNC (g_main_loop_quit), + g_source_set_callback (src, stop_main_loop_when_idle, g_main_loop_ref (loop), (GDestroyNotify) g_main_loop_unref); g_source_attach (src, g_main_loop_get_context (loop)); g_source_unref (src); |