mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 22:16:16 +01:00
tests: Fix a memory leak in the mainloop test
The source needs to be removed from the `GMainContext` before being unreffed, otherwise the main context and main loop will be kept around. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
ba556e6d34
commit
2bc1036f80
@ -1687,10 +1687,11 @@ threadf (gpointer data)
|
||||
source = g_timeout_source_new (250);
|
||||
g_source_set_callback (source, timeout_cb, loop, NULL);
|
||||
g_source_attach (source, context);
|
||||
g_source_unref (source);
|
||||
|
||||
g_main_loop_run (loop);
|
||||
|
||||
g_source_destroy (source);
|
||||
g_source_unref (source);
|
||||
g_main_loop_unref (loop);
|
||||
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user