From 3a4b236e6dfab4335f1a04f37f8e5b8ed43659ba Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Fri, 2 Aug 2024 10:24:17 -0500 Subject: [PATCH] re-use code to cancel old timer --- src/apprt/gtk/App.zig | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 80ea89ca9..f542e300e 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -523,11 +523,7 @@ pub fn gtkQuitTimerExpired(ud: ?*anyopaque) callconv(.C) c.gboolean { /// This will get called when there are no more open surfaces. pub fn startQuitTimer(self: *App) void { // Cancel any previous timeout. - if (self.quit_timer_source) |source| { - if (c.g_source_remove(source) == c.FALSE) - log.warn("unable to remove quit timer {d}", .{source}); - self.quit_timer_source = null; - } + self.cancelQuitTimer(); // This is a no-op unless we are configured to quit after last window is closed. if (!self.config.@"quit-after-last-window-closed") return;