Open sparist opened 2 years ago
The tricky thing with fixing this is that WGPUSwapChain
is a typedef of struct WGPUSwapChainImpl *
, which is an incomplete type at this point, so calling delete
on it is ill-advised. In order to delete it properly, the code needs to have access to the definition of struct WGPUSwapChainImpl
, but I can't seem to find it.
It appears that the new WGPUSwapChainImpl pointer returned by wgpuDeviceCreateSwapChain() does not get deleted; this causes AddressSanitizer to flag the leak. See the
instance
variable in the code snippet below: