mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-01-06 21:37:49 +00:00
gtk: refactor the Paned deinit method
This commit is contained in:
committed by
Mitchell Hashimoto
parent
adba77c3f9
commit
34e4261210
@@ -220,19 +220,13 @@ fn surfaceInPosition(self: *Paned, position: Position) ?*Surface {
|
||||
}
|
||||
|
||||
pub fn deinit(self: *Paned, alloc: Allocator) void {
|
||||
switch (self.child1) {
|
||||
.none, .surface => {},
|
||||
.paned => |paned| {
|
||||
paned.deinit(alloc);
|
||||
alloc.destroy(paned);
|
||||
},
|
||||
}
|
||||
|
||||
switch (self.child2) {
|
||||
.none, .surface => {},
|
||||
.paned => |paned| {
|
||||
paned.deinit(alloc);
|
||||
alloc.destroy(paned);
|
||||
},
|
||||
for ([_]Child{ self.child1, self.child2 }) |child| {
|
||||
switch (child) {
|
||||
.none, .surface => continue,
|
||||
.paned => |paned| {
|
||||
paned.deinit(alloc);
|
||||
alloc.destroy(paned);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user