From 7aa26cc45050d2eccfee1bfc1ccef5794125e354 Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Mon, 4 Nov 2024 11:32:40 +0100 Subject: [PATCH] Prevent extra errors when canvascontext creation fails --- wgpu/backends/wgpu_native/_api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wgpu/backends/wgpu_native/_api.py b/wgpu/backends/wgpu_native/_api.py index 9bc3b8e4..01fc11f0 100644 --- a/wgpu/backends/wgpu_native/_api.py +++ b/wgpu/backends/wgpu_native/_api.py @@ -519,6 +519,8 @@ class GPUCanvasContext(classes.GPUCanvasContext): # we can give meaningful errors/warnings on invalid use, rather than # the more cryptic Rust panics. + _surface_id = ffi.NULL + def __init__(self, canvas): super().__init__(canvas)