From 077a0481c4a68547bc5729845d445c05cfb9d22f Mon Sep 17 00:00:00 2001 From: Sergii Liebodkin Date: Fri, 22 Nov 2024 08:41:37 +0000 Subject: [PATCH] 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 --- examples/Example.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/Example.h b/examples/Example.h index 34749e8a..49a7835b 100644 --- a/examples/Example.h +++ b/examples/Example.h @@ -425,6 +425,8 @@ struct WgWindow : Window virtual ~WgWindow() { + //the canvas is tightly relying on the wgpu resource. cut out before rleasing them for safety. + static_cast(canvas)->target(nullptr, nullptr, nullptr, 0, 0); wgpuSurfaceRelease(surface); wgpuInstanceRelease(instance); }