mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
renderer/opengl: reclaim cell buffer memory when resizing
This commit is contained in:
@ -1259,6 +1259,12 @@ pub fn setScreenSize(
|
|||||||
if (single_threaded_draw) self.draw_mutex.lock();
|
if (single_threaded_draw) self.draw_mutex.lock();
|
||||||
defer if (single_threaded_draw) self.draw_mutex.unlock();
|
defer if (single_threaded_draw) self.draw_mutex.unlock();
|
||||||
|
|
||||||
|
// Reset our buffer sizes so that we free memory when the screen shrinks.
|
||||||
|
// This could be made more clever by only doing this when the screen
|
||||||
|
// shrinks but the performance cost really isn't that much.
|
||||||
|
self.cells.clearAndFree(self.alloc);
|
||||||
|
self.cells_bg.clearAndFree(self.alloc);
|
||||||
|
|
||||||
// Store our screen size
|
// Store our screen size
|
||||||
self.screen_size = dim;
|
self.screen_size = dim;
|
||||||
self.padding.explicit = pad;
|
self.padding.explicit = pad;
|
||||||
|
Reference in New Issue
Block a user