From 250f535abe5b08bbe8341f0a0277cff8e6453584 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Wed, 25 Feb 2026 09:52:06 -0600 Subject: [PATCH] rm dupavlue and freevalue --- layout.c | 4 ---- prosperon.c | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/layout.c b/layout.c index e11c5b7d..e79dda00 100644 --- a/layout.c +++ b/layout.c @@ -44,8 +44,6 @@ static JSValue js_layout_set_size(JSContext *js, JSValueConst self, int argc, JS JSValue height_val = JS_GetPropertyNumber(js, argv[1], 1); JS_ToFloat64(js, &width, width_val); JS_ToFloat64(js, &height, height_val); - JS_FreeValue(js, width_val); - JS_FreeValue(js, height_val); } else { // Handle object with x,y or width,height properties JSValue width_val = JS_GetPropertyStr(js, argv[1], "width"); @@ -58,8 +56,6 @@ static JSValue js_layout_set_size(JSContext *js, JSValueConst self, int argc, JS } JS_ToFloat64(js, &width, width_val); JS_ToFloat64(js, &height, height_val); - JS_FreeValue(js, width_val); - JS_FreeValue(js, height_val); } if (isnan(width)) width = 0; diff --git a/prosperon.c b/prosperon.c index d5db78d4..201c9b4b 100644 --- a/prosperon.c +++ b/prosperon.c @@ -73,7 +73,7 @@ float *js2floats(JSContext *js, JSValue v, size_t *len) *len = JS_ArrayLength(js,v); float *arr = malloc(sizeof(float)* *len); for (int i = 0; i < *len; i++) - { JSValue val = JS_GetPropertyNumber(js,v,i); arr[i] = js2number(js, val); JS_FreeValue(js,val); } + { JSValue val = JS_GetPropertyNumber(js,v,i); arr[i] = js2number(js, val); } return arr; } @@ -82,7 +82,7 @@ double *js2doubles(JSContext *js, JSValue v, size_t *len) *len = JS_ArrayLength(js,v); double *arr = malloc(sizeof(double)* *len); for (int i = 0; i < *len; i++) - { JSValue val = JS_GetPropertyNumber(js,v,i); arr[i] = js2number(js, val); JS_FreeValue(js,val); } + { JSValue val = JS_GetPropertyNumber(js,v,i); arr[i] = js2number(js, val); } return arr; }