From 411f3ef661362bd97b4f13ff4b9ce82876c5947b Mon Sep 17 00:00:00 2001 From: Michael Gratton Date: Wed, 4 Dec 2019 09:48:47 +0800 Subject: [PATCH] Warn about bad shutdowns so they can be caught and diagnosed --- src/client/application/application-client.vala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/client/application/application-client.vala b/src/client/application/application-client.vala index 8e35ad3a..b9504edd 100644 --- a/src/client/application/application-client.vala +++ b/src/client/application/application-client.vala @@ -761,8 +761,12 @@ public class Application.Client : Gtk.Application { int64 delta_usec = get_monotonic_time() - start_usec; if (delta_usec >= FORCE_SHUTDOWN_USEC) { - debug("Forcing shutdown of Geary, %ss passed...", - (delta_usec / USEC_PER_SEC).to_string()); + // Use a warning here so a) it's usually logged + // and b) we can run under gdb with + // G_DEBUG=fatal-warnings and have it break when + // this happens, and maybe debug it. + warning("Forcing shutdown of Geary, %ss passed...", + (delta_usec / USEC_PER_SEC).to_string()); Posix.exit(2); } }