mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-23 20:26:09 +03:00
renderer/metal: properly release texture descriptors
Fixes memory leak. We always need to release these descriptors; the textures themselves will retain or copy them if necessary.
This commit is contained in:
@ -68,7 +68,7 @@ pub fn init(opts: Options) !Self {
|
||||
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
||||
break :init id_init;
|
||||
};
|
||||
errdefer desc.msgSend(void, objc.sel("release"), .{});
|
||||
defer desc.release();
|
||||
|
||||
// Set our properties
|
||||
desc.setProperty("width", @as(c_ulong, @intCast(opts.width)));
|
||||
|
@ -50,7 +50,7 @@ pub fn init(
|
||||
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
||||
break :init id_init;
|
||||
};
|
||||
errdefer desc.msgSend(void, objc.sel("release"), .{});
|
||||
defer desc.release();
|
||||
|
||||
// Set our properties
|
||||
desc.setProperty("pixelFormat", @intFromEnum(opts.pixel_format));
|
||||
|
Reference in New Issue
Block a user