From e40b79906eb3faa6d4c0d5e0e7b73e706165f727 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 1 Dec 2023 09:07:09 -0800 Subject: [PATCH] apprt/gtk: do not deinit tab in closeTab --- src/apprt/gtk/Window.zig | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/apprt/gtk/Window.zig b/src/apprt/gtk/Window.zig index 1d02ba80c..3fe96a498 100644 --- a/src/apprt/gtk/Window.zig +++ b/src/apprt/gtk/Window.zig @@ -205,10 +205,8 @@ pub fn closeTab(self: *Window, tab: *Tab) void { // Find page and tab which we're closing const page_idx = getNotebookPageIndex(page); - // Deallocate the tab - tab.deinit(self.app.core_app.alloc); - self.app.core_app.alloc.destroy(tab); - + // Remove the page. This will destroy the GTK widgets in the page which + // will trigger Tab cleanup. c.gtk_notebook_remove_page(self.notebook, page_idx); const remaining = c.gtk_notebook_get_n_pages(self.notebook);