Control: retitle -1 GFileMonitor can deadlock if not cancelled before last unref Control: severity -1 normal
On Wed, 18 Mar 2020 at 09:37:15 +0000, Simon McVittie wrote: > Looks like <https://gitlab.gnome.org/GNOME/glib/issues/1941>. The > workaround, which gegl might be able to use, is to always cancel > file monitors before their last-unref is reached. I have done that in gegl and it seems to have resolved the FTBFS. According to GLib developers, best-practice is to cancel file monitors, close files and sockets, etc. before their last-unref *anyway*, similar to the advice given for file-like objects in modern Python: this avoids doing complicated things in the dispose() and finalize() callbacks, and avoids leaking resources if a reference cycle, a temporary ref taken while delivering events or a ref taken by a worker thread keeps the object alive. So this workaround is not just a workaround, it is also an improvement to gegl. smcv