renderer: clarify why SwapChain.defunct is required

pull/7620/head
Qwerasd 2025-06-20 14:56:18 -06:00
parent 6b7d751007
commit 2f10caec8f
1 changed files with 4 additions and 0 deletions

View File

@ -217,6 +217,10 @@ pub fn Renderer(comptime GraphicsAPI: type) type {
/// Set to true when deinited, if you try to deinit a defunct /// Set to true when deinited, if you try to deinit a defunct
/// swap chain it will just be ignored, to prevent double-free. /// swap chain it will just be ignored, to prevent double-free.
///
/// This is required because of `displayUnrealized`, since it
/// `deinits` the swapchain, which leads to a double-free if
/// the renderer is deinited after that.
defunct: bool = false, defunct: bool = false,
pub fn init(api: GraphicsAPI, custom_shaders: bool) !SwapChain { pub fn init(api: GraphicsAPI, custom_shaders: bool) !SwapChain {