application: Wait until all async database operations finished
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 <agx@sigxcpu.org> Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/795>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user