renderer: clarify why SwapChain.defunct is required

This commit is contained in:
Qwerasd
2025-06-20 14:56:18 -06:00
parent 6b7d751007
commit 2f10caec8f

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
/// 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,
pub fn init(api: GraphicsAPI, custom_shaders: bool) !SwapChain {