Skip to content

gmain: Fix possible locking issue in source unref

Benjamin Berg requested to merge benzea/fix-possible-source-locking-issue into master

When unref'ing child sources, the lock is already held. But instead of passing TRUE to g_source_unref_internal it currently passes whether the lock was already held outside of the current invocation. Just pass TRUE to fix this possible issue.

NOTE: I found this while trying to understand what may be going wrong in gnome-network-displays#156 (comment 933074). But I don't think that is causing the issue there (we are unref'ing the child source there from the finalize handler). Quite likely, there is a memory corruption.

But, I think this bugfix is correct, hence submitting it anyway.

Merge request reports