mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +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 {
|
pub fn deinit(self: *Paned, alloc: Allocator) void {
|
||||||
switch (self.child1) {
|
for ([_]Child{ self.child1, self.child2 }) |child| {
|
||||||
.none, .surface => {},
|
switch (child) {
|
||||||
|
.none, .surface => continue,
|
||||||
.paned => |paned| {
|
.paned => |paned| {
|
||||||
paned.deinit(alloc);
|
paned.deinit(alloc);
|
||||||
alloc.destroy(paned);
|
alloc.destroy(paned);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (self.child2) {
|
|
||||||
.none, .surface => {},
|
|
||||||
.paned => |paned| {
|
|
||||||
paned.deinit(alloc);
|
|
||||||
alloc.destroy(paned);
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user