mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-05 23:48:44 +02:00
Fix a possible deadlock
the FdSource was calling g_cancellable_disconnect while holding the main context lock, which is bad news if the ::cancelled handler is trying to get that lock to wake up the mainloop... Bug 586432
This commit is contained in:
@@ -86,9 +86,13 @@ fd_source_finalize (GSource *source)
|
||||
{
|
||||
FDSource *fd_source = (FDSource *)source;
|
||||
|
||||
/* we don't use g_cancellable_disconnect() here, since we are holding
|
||||
* the main context lock here, and the ::disconnect signal handler
|
||||
* will try to grab that, and deadlock looms.
|
||||
*/
|
||||
if (fd_source->cancelled_tag)
|
||||
g_cancellable_disconnect (fd_source->cancellable,
|
||||
fd_source->cancelled_tag);
|
||||
g_signal_handler_disconnect (fd_source->cancellable,
|
||||
fd_source->cancelled_tag);
|
||||
|
||||
if (fd_source->cancellable)
|
||||
g_object_unref (fd_source->cancellable);
|
||||
|
Reference in New Issue
Block a user