mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
gtk: proper surface cleanup
This commit is contained in:
@ -292,6 +292,7 @@ pub const Surface = struct {
|
|||||||
/// "destroy" signal for surface
|
/// "destroy" signal for surface
|
||||||
fn gtkDestroy(v: *c.GtkWidget, ud: ?*anyopaque) callconv(.C) void {
|
fn gtkDestroy(v: *c.GtkWidget, ud: ?*anyopaque) callconv(.C) void {
|
||||||
_ = v;
|
_ = v;
|
||||||
|
log.debug("gl destroy", .{});
|
||||||
|
|
||||||
const self = userdataSelf(ud.?);
|
const self = userdataSelf(ud.?);
|
||||||
const alloc = self.app.core_app.alloc;
|
const alloc = self.app.core_app.alloc;
|
||||||
@ -304,7 +305,14 @@ pub const Surface = struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn deinit(self: *Surface) void {
|
pub fn deinit(self: *Surface) void {
|
||||||
_ = self;
|
// We don't allocate anything if we aren't realized.
|
||||||
|
if (!self.realized) return;
|
||||||
|
|
||||||
|
// Remove ourselves from the list of known surfaces in the app.
|
||||||
|
self.app.core_app.deleteSurface(self);
|
||||||
|
|
||||||
|
// Clean up our core surface so that all the rendering and IO stop.
|
||||||
|
self.core_surface.deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn setShouldClose(self: *Surface) void {
|
pub fn setShouldClose(self: *Surface) void {
|
||||||
|
Reference in New Issue
Block a user