mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-05 10:38:08 +01:00
tests: Fix a double-close of a GSource in tests
This bug only gets triggered on BSD, because it calls `recv_message()` with `G_IO_HUP | G_IO_IN`. That takes two code paths in `recv_message()`, and ends up calling `shutdown_source()` twice. The second call causes a critical warning. Fixes: https://gitlab.gnome.org/GNOME/glib/-/jobs/2004192 Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
6ad8205949
commit
7137591775
@ -96,8 +96,13 @@ read_all (int fd,
|
|||||||
static void
|
static void
|
||||||
shutdown_source (gpointer data)
|
shutdown_source (gpointer data)
|
||||||
{
|
{
|
||||||
if (g_source_remove (*(guint *) data))
|
guint *fd_ptr = data;
|
||||||
|
|
||||||
|
if (*fd_ptr != 0)
|
||||||
{
|
{
|
||||||
|
g_source_remove (*fd_ptr);
|
||||||
|
*fd_ptr = 0;
|
||||||
|
|
||||||
nrunning--;
|
nrunning--;
|
||||||
if (nrunning == 0)
|
if (nrunning == 0)
|
||||||
g_main_loop_quit (main_loop);
|
g_main_loop_quit (main_loop);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user