1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[quickjs] nodelist FreeValue

This commit is contained in:
Witold Filipczyk 2023-01-21 19:05:52 +01:00
parent 8e5d90d155
commit 642b94f03f
2 changed files with 6 additions and 2 deletions

View File

@ -207,8 +207,10 @@ js_element_get_property_childNodes(JSContext *ctx, JSValueConst this_val)
delete nodes;
return JS_NULL;
}
JSValue rr = getNodeList(ctx, nodes);
JS_FreeValue(ctx, rr);
return getNodeList(ctx, nodes);
RETURN_JS(rr);
}
static JSValue

View File

@ -170,6 +170,7 @@ js_nodeList_set_items(JSContext *ctx, JSValue this_val, void *node)
REF_JS(obj);
JS_SetPropertyUint32(ctx, this_val, i, JS_DupValue(ctx, obj));
JS_FreeValue(ctx, obj);
}
}
}
@ -228,6 +229,7 @@ getNodeList(JSContext *ctx, void *node)
map_nodelist[node] = nodeList_obj;
js_nodeList_SetOpaque(nodeList_obj, node);
js_nodeList_set_items(ctx, nodeList_obj, node);
JSValue rr = JS_DupValue(ctx, nodeList_obj);
RETURN_JS(nodeList_obj);
RETURN_JS(rr);
}