mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-01 21:33:09 +02:00
glocalfilemonitor: Avoid a deadlock on finalization
If `g_file_monitor_source_dispatch()` drops the last reference to its `GLocalFileMonitor`, a deadlock will occur, because disposing the `GLocalFileMonitor` causes synchronous disposal of the `GFileMonitorSource`, and hence an attempt to re-lock the already-locked mutex in the `GFileMonitorSource`. Fix that by dropping the reference to the `GLocalFileMonitor` after unlocking. Diagnosed by Ting-Wei Lan. The bug was originally introduced by me in commit 592a13b483. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
8249f624ed
commit
f49710b8aa
@ -555,8 +555,8 @@ g_file_monitor_source_dispatch (GSource *source,
|
|||||||
|
|
||||||
g_file_monitor_source_update_ready_time (fms);
|
g_file_monitor_source_update_ready_time (fms);
|
||||||
|
|
||||||
g_clear_object (&instance);
|
|
||||||
g_mutex_unlock (&fms->lock);
|
g_mutex_unlock (&fms->lock);
|
||||||
|
g_clear_object (&instance);
|
||||||
|
|
||||||
/* We now have our list of events to deliver */
|
/* We now have our list of events to deliver */
|
||||||
while ((event = g_queue_pop_head (&event_queue)))
|
while ((event = g_queue_pop_head (&event_queue)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user