mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03: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