From 32a88ecd8097d77549fc49518b81466d3ed07dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Mon, 13 Oct 2025 11:51:00 +0200 Subject: [PATCH] application: Wait until all async database operations finished MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When shutting down make sure there are no in-flight database operations. Otherwise the database might not be closed correctly. Improves fix for https://gitlab.gnome.org/GNOME/calls/-/issues/508 Signed-off-by: Guido Günther Part-of: --- src/calls-application.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/calls-application.c b/src/calls-application.c index daeec76..b4f358a 100644 --- a/src/calls-application.c +++ b/src/calls-application.c @@ -582,6 +582,13 @@ app_shutdown (GApplication *application) g_main_context_iteration (context, TRUE); } + while (self->record_store && calls_record_store_is_busy (self->record_store)) { + if (g_timer_elapsed (timer, NULL) > 10) + break; + + g_main_context_iteration (context, TRUE); + } + cui_uninit (); G_APPLICATION_CLASS (calls_application_parent_class)->shutdown (application);