From cf578d8efe6ca7ccbe3baec9b15d04d36f1558d6 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Fri, 6 Oct 2023 11:40:14 -0300 Subject: [PATCH] Fix object memory leak in `CanvasRenderingContext2D` --- .changeset/warm-lobsters-hope.md | 5 +++++ source/canvas.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 .changeset/warm-lobsters-hope.md diff --git a/.changeset/warm-lobsters-hope.md b/.changeset/warm-lobsters-hope.md new file mode 100644 index 00000000..5527711b --- /dev/null +++ b/.changeset/warm-lobsters-hope.md @@ -0,0 +1,5 @@ +--- +'nxjs-runtime': patch +--- + +Fix object memory leak in `CanvasRenderingContext2D` diff --git a/source/canvas.c b/source/canvas.c index cf5bb6f7..3b1515c3 100644 --- a/source/canvas.c +++ b/source/canvas.c @@ -103,9 +103,6 @@ static JSValue js_canvas_new_context(JSContext *ctx, JSValueConst this_val, int return obj; } - // TOOD: this probably needs to go into `framebuffer_init` instead - JS_DupValue(ctx, obj); - // On Switch, the byte order seems to be BGRA cairo_surface_t *surface = cairo_image_surface_create_for_data( buffer, CAIRO_FORMAT_ARGB32, width, height, width * 4);