gtk: use deinit method on Paned consistently

This commit is contained in:
Thorsten Ball
2023-10-27 06:09:05 +02:00
committed by Mitchell Hashimoto
parent 77b8e3c956
commit d88c29377b

View File

@ -256,7 +256,7 @@ pub fn closeTab(self: *Window, tab: *Tab) void {
pub fn closeSurface(self: *Window, surface: *Surface) void {
assert(surface.window == self);
const alloc = surface.app.core_app.alloc;
const alloc = self.app.core_app.alloc;
switch (surface.parent) {
.none => unreachable,
@ -288,8 +288,9 @@ pub fn closeSurface(self: *Window, surface: *Surface) void {
// Remove reference on the surface we're closing
surface.setParent(.none);
// Remove children and kill Paned.
// Remove children.
paned.removeChildren();
// Don't need to call paned.deinit, because we already removed children.
defer alloc.destroy(paned);
switch (paned.parent) {