mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
gtk: fix closing of surfaces by releasing the ref to gl_area
This commit is contained in:

committed by
Mitchell Hashimoto

parent
956fcf7349
commit
ecbe910714
@ -387,6 +387,12 @@ pub fn deinit(self: *Surface) void {
|
|||||||
if (self.cursor) |cursor| c.g_object_unref(cursor);
|
if (self.cursor) |cursor| c.g_object_unref(cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// shutdown removes the long-held reference to the gl_area and kicks off the
|
||||||
|
// deinit/destroy process for this surface.
|
||||||
|
pub fn shutdown(self: *Surface) void {
|
||||||
|
c.g_object_unref(self.gl_area);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: move this
|
// TODO: move this
|
||||||
/// Change the container for the surface to `container`.
|
/// Change the container for the surface to `container`.
|
||||||
pub fn setContainer(self: *Surface, container: Container) void {
|
pub fn setContainer(self: *Surface, container: Container) void {
|
||||||
|
@ -151,7 +151,8 @@ pub fn init(self: *Tab, window: *Window, parent_: ?*CoreSurface) !void {
|
|||||||
/// Deinits tab by deiniting child if child is Paned.
|
/// Deinits tab by deiniting child if child is Paned.
|
||||||
pub fn deinit(self: *Tab) void {
|
pub fn deinit(self: *Tab) void {
|
||||||
switch (self.child) {
|
switch (self.child) {
|
||||||
.none, .surface => return,
|
.none => return,
|
||||||
|
.surface => |s| s.shutdown(),
|
||||||
.paned => |paned| {
|
.paned => |paned| {
|
||||||
paned.deinit(self.window.app.core_app.alloc);
|
paned.deinit(self.window.app.core_app.alloc);
|
||||||
self.window.app.core_app.alloc.destroy(paned);
|
self.window.app.core_app.alloc.destroy(paned);
|
||||||
|
Reference in New Issue
Block a user