mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
wg_engine: reset context in examples
Fix examples termination process: reset context while window releasing before webgpu instance released Issue https://github.com/thorvg/thorvg/issues/2745
This commit is contained in:
parent
d0bc4bc4f5
commit
077a0481c4
1 changed files with 2 additions and 0 deletions
|
@ -425,6 +425,8 @@ struct WgWindow : Window
|
||||||
|
|
||||||
virtual ~WgWindow()
|
virtual ~WgWindow()
|
||||||
{
|
{
|
||||||
|
//the canvas is tightly relying on the wgpu resource. cut out before rleasing them for safety.
|
||||||
|
static_cast<tvg :: WgCanvas*>(canvas)->target(nullptr, nullptr, nullptr, 0, 0);
|
||||||
wgpuSurfaceRelease(surface);
|
wgpuSurfaceRelease(surface);
|
||||||
wgpuInstanceRelease(instance);
|
wgpuInstanceRelease(instance);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue