mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
metal: do not use setPurgeableState on MTLTexture/Buffer
The Metal system automatically will free hardware resources when no other references exist (I believe) and this causes a crash if you close a window while a render is in-flight.
This commit is contained in:
@ -1365,7 +1365,6 @@ fn initAtlasTexture(device: objc.Object, atlas: *const font.Atlas) !objc.Object
|
|||||||
/// Deinitialize a metal resource (buffer, texture, etc.) and free the
|
/// Deinitialize a metal resource (buffer, texture, etc.) and free the
|
||||||
/// memory associated with it.
|
/// memory associated with it.
|
||||||
fn deinitMTLResource(obj: objc.Object) void {
|
fn deinitMTLResource(obj: objc.Object) void {
|
||||||
obj.msgSend(void, objc.sel("setPurgeableState:"), .{@enumToInt(MTLPurgeableState.empty)});
|
|
||||||
obj.msgSend(void, objc.sel("release"), .{});
|
obj.msgSend(void, objc.sel("release"), .{});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user