Skip to content

Commit

Permalink
Fix object memory leak in CanvasRenderingContext2D
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Oct 6, 2023
1 parent 78e4790 commit cf578d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-lobsters-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'nxjs-runtime': patch
---

Fix object memory leak in `CanvasRenderingContext2D`
3 changes: 0 additions & 3 deletions source/canvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cf578d8

Please sign in to comment.