diff --git a/src/apprt/gtk/TabView.zig b/src/apprt/gtk/TabView.zig index c702b0513..a024c0092 100644 --- a/src/apprt/gtk/TabView.zig +++ b/src/apprt/gtk/TabView.zig @@ -196,8 +196,6 @@ pub fn closeTab(self: *TabView, tab: *Tab) void { // If we have no more tabs we close the window if (self.nPages() == 0) { - const window: *gtk.Window = @ptrCast(@alignCast(tab.window.window)); - // libadw versions <= 1.3.x leak the final page view // which causes our surface to not properly cleanup. We // unref to force the cleanup. This will trigger a critical @@ -209,10 +207,6 @@ pub fn closeTab(self: *TabView, tab: *Tab) void { const box: *gtk.Box = @ptrCast(@alignCast(tab.box)); box.as(gobject.Object).unref(); } - - // `self` will become invalid after this call because it will have - // been freed up as part of the process of closing the window. - window.destroy(); } }