mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 08:16:13 +03:00
gtk: use deinit method on Paned consistently
This commit is contained in:

committed by
Mitchell Hashimoto

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