mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-22 19:56:08 +03:00
add CFReleasePool handling to OpenGL renderer
This commit is contained in:
@ -1025,7 +1025,16 @@ pub fn rebuildCells(
|
|||||||
while (try iter.next(self.alloc)) |run| {
|
while (try iter.next(self.alloc)) |run| {
|
||||||
// Try to read the cells from the shaping cache if we can.
|
// Try to read the cells from the shaping cache if we can.
|
||||||
const shaper_cells = self.font_shaper_cache.get(run) orelse cache: {
|
const shaper_cells = self.font_shaper_cache.get(run) orelse cache: {
|
||||||
const cells = try self.font_shaper.shape(run);
|
const cells = if (font.options.backend == .coretext) ct: {
|
||||||
|
var cf_release_pool = std.ArrayList(*anyopaque).init(self.alloc);
|
||||||
|
defer {
|
||||||
|
for (cf_release_pool.items) |ref| {
|
||||||
|
@import("macos").foundation.CFRelease(ref);
|
||||||
|
}
|
||||||
|
cf_release_pool.deinit();
|
||||||
|
}
|
||||||
|
break :ct try self.font_shaper.shape(run, &cf_release_pool);
|
||||||
|
} else try self.font_shaper.shape(run);
|
||||||
|
|
||||||
// Try to cache them. If caching fails for any reason we continue
|
// Try to cache them. If caching fails for any reason we continue
|
||||||
// because it is just a performance optimization, not a correctness
|
// because it is just a performance optimization, not a correctness
|
||||||
|
Reference in New Issue
Block a user