mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-08 00:48:45 +02:00
gnetworkmonitor: Fix use-after-free when using from another thread
When using g_network_monitor_get_default() from another thread, it’s possible for network-changed events to be processed after an instance of GNetworkMonitor has been disposed, causing use-after-free problems. Fix that by moving some of the initialisation into the GInitable.init() chain, rather than in a main context idle callback. This includes a unit test which probabilistically reproduces the bug (but can’t do so deterministically due to it being a race condition). Commit amended by Philip Withnall <withnall@endlessm.com> before pushing. https://bugzilla.gnome.org/show_bug.cgi?id=793727
This commit is contained in:
committed by
Philip Withnall
parent
24e80aac1f
commit
ca0add4b8a
@@ -49,6 +49,7 @@ test_programs = \
|
||||
monitor \
|
||||
network-address \
|
||||
network-monitor \
|
||||
network-monitor-race \
|
||||
permission \
|
||||
pollable \
|
||||
proxy-test \
|
||||
|
Reference in New Issue
Block a user