mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
gtk: rename and refactor Tab.deinit
This commit is contained in:

committed by
Mitchell Hashimoto

parent
34e4261210
commit
fde6289880
@ -164,13 +164,9 @@ fn gtkTabCloseClick(_: *c.GtkButton, ud: ?*anyopaque) callconv(.C) void {
|
||||
window.closeTab(tab);
|
||||
}
|
||||
|
||||
pub fn close(self: *Tab) void {
|
||||
pub fn deinit(self: *Tab) void {
|
||||
switch (self.child) {
|
||||
.none => return,
|
||||
.surface => {
|
||||
// TODO: I'm not 100% but I don't think we have to do something
|
||||
return;
|
||||
},
|
||||
.none, .surface => return,
|
||||
.paned => |paned| {
|
||||
paned.deinit(self.window.app.core_app.alloc);
|
||||
self.window.app.core_app.alloc.destroy(paned);
|
||||
|
@ -190,7 +190,7 @@ fn initActions(self: *Window) void {
|
||||
pub fn deinit(self: *Window) void {
|
||||
self.icon.deinit(self.app);
|
||||
for (self.tabs.items) |tab| {
|
||||
tab.close();
|
||||
tab.deinit();
|
||||
self.app.core_app.alloc.destroy(tab);
|
||||
}
|
||||
self.tabs.deinit(self.app.core_app.alloc);
|
||||
@ -217,7 +217,7 @@ pub fn removeTab(self: *Window, tab: *Tab) !void {
|
||||
if (tab_idx) |idx| _ = self.tabs.orderedRemove(idx) else return error.TabNotFound;
|
||||
|
||||
// Deallocate the tab
|
||||
tab.close();
|
||||
tab.deinit();
|
||||
self.app.core_app.alloc.destroy(tab);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user