From 537c3bb2c8d821be26d8b4e1baf4323cf3d0cd59 Mon Sep 17 00:00:00 2001 From: Jehan Date: Sat, 21 Sep 2024 18:25:18 +0200 Subject: [PATCH] app: don't inhibit or uninhibit when there is no GtkApplication. I had the case when gimp_exit_idle_cleanup_stray_images() would clean up some images on exit, apparently after the GtkApplication is itself already gone. --- app/gui/gui-vtable.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c index e57c5b4c8f..6d5b6ebae5 100644 --- a/app/gui/gui-vtable.c +++ b/app/gui/gui-vtable.c @@ -1001,6 +1001,11 @@ gui_inhibit (Gimp *gimp) } app = GTK_APPLICATION (g_application_get_default ()); + if (app == NULL) + /* This may happen when quitting. The GtkApplication is finalized + * faster than the images without display. + */ + return; if (gimp_displays_dirty (gimp)) {