[gegl/wip/issue226: 2/2] file backend: Explicitly cancel file monitor
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/wip/issue226: 2/2] file backend: Explicitly cancel file monitor
- Date: Wed, 18 Mar 2020 13:20:07 +0000 (UTC)
commit 28cdb2b0b7fe916656d0d4631aa088a98579a2c7
Author: Simon McVittie <smcv debian org>
Date: Wed Mar 18 10:00:26 2020 +0000
file backend: Explicitly cancel file monitor
If we don't cancel it before unreffing it, its last-unref might happen
on the worker thread, which can lead to a deadlock.
Workaround for <https://gitlab.gnome.org/GNOME/glib/issues/1941>.
Signed-off-by: Simon McVittie <smcv debian org>
Resolves: https://gitlab.gnome.org/GNOME/gegl/issues/226
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=954197
gegl/buffer/gegl-tile-backend-file-async.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gegl/buffer/gegl-tile-backend-file-async.c b/gegl/buffer/gegl-tile-backend-file-async.c
index 937c9a40d..67165c4b6 100644
--- a/gegl/buffer/gegl-tile-backend-file-async.c
+++ b/gegl/buffer/gegl-tile-backend-file-async.c
@@ -981,7 +981,10 @@ gegl_tile_backend_file_finalize (GObject *object)
}
if (self->monitor)
- g_object_unref (self->monitor);
+ {
+ g_file_monitor_cancel (self->monitor);
+ g_object_unref (self->monitor);
+ }
if (self->file)
g_object_unref (self->file);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]