mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +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);
|
window.closeTab(tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn close(self: *Tab) void {
|
pub fn deinit(self: *Tab) void {
|
||||||
switch (self.child) {
|
switch (self.child) {
|
||||||
.none => return,
|
.none, .surface => return,
|
||||||
.surface => {
|
|
||||||
// TODO: I'm not 100% but I don't think we have to do something
|
|
||||||
return;
|
|
||||||
},
|
|
||||||
.paned => |paned| {
|
.paned => |paned| {
|
||||||
paned.deinit(self.window.app.core_app.alloc);
|
paned.deinit(self.window.app.core_app.alloc);
|
||||||
self.window.app.core_app.alloc.destroy(paned);
|
self.window.app.core_app.alloc.destroy(paned);
|
||||||
|
@ -190,7 +190,7 @@ fn initActions(self: *Window) void {
|
|||||||
pub fn deinit(self: *Window) void {
|
pub fn deinit(self: *Window) void {
|
||||||
self.icon.deinit(self.app);
|
self.icon.deinit(self.app);
|
||||||
for (self.tabs.items) |tab| {
|
for (self.tabs.items) |tab| {
|
||||||
tab.close();
|
tab.deinit();
|
||||||
self.app.core_app.alloc.destroy(tab);
|
self.app.core_app.alloc.destroy(tab);
|
||||||
}
|
}
|
||||||
self.tabs.deinit(self.app.core_app.alloc);
|
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;
|
if (tab_idx) |idx| _ = self.tabs.orderedRemove(idx) else return error.TabNotFound;
|
||||||
|
|
||||||
// Deallocate the tab
|
// Deallocate the tab
|
||||||
tab.close();
|
tab.deinit();
|
||||||
self.app.core_app.alloc.destroy(tab);
|
self.app.core_app.alloc.destroy(tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user