mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[quickjs] some finalizers
This commit is contained in:
parent
d8794b5aec
commit
a754b39287
@ -117,9 +117,13 @@ static
|
|||||||
void js_attr_finalizer(JSRuntime *rt, JSValue val)
|
void js_attr_finalizer(JSRuntime *rt, JSValue val)
|
||||||
{
|
{
|
||||||
REF_JS(val);
|
REF_JS(val);
|
||||||
void *node = JS_GetOpaque(val, js_attr_class_id);
|
dom_attr *node = (dom_attr *)JS_GetOpaque(val, js_attr_class_id);
|
||||||
|
|
||||||
attr_erase_from_map(map_attrs, node);
|
attr_erase_from_map(map_attrs, node);
|
||||||
|
|
||||||
|
if (node) {
|
||||||
|
dom_node_unref(node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static JSClassDef js_attr_class = {
|
static JSClassDef js_attr_class = {
|
||||||
|
@ -1713,9 +1713,12 @@ js_doctype_finalizer(JSRuntime *rt, JSValue val)
|
|||||||
{
|
{
|
||||||
REF_JS(val);
|
REF_JS(val);
|
||||||
|
|
||||||
void *node = JS_GetOpaque(val, js_doctype_class_id);
|
dom_node *node = (dom_node *)JS_GetOpaque(val, js_doctype_class_id);
|
||||||
|
|
||||||
attr_erase_from_map(map_doctypes, node);
|
attr_erase_from_map(map_doctypes, node);
|
||||||
|
|
||||||
|
if (node) {
|
||||||
|
dom_node_unref(node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static JSClassDef js_doctype_class = {
|
static JSClassDef js_doctype_class = {
|
||||||
|
@ -2487,6 +2487,11 @@ void js_element_finalizer(JSRuntime *rt, JSValue val)
|
|||||||
|
|
||||||
if (el_private) {
|
if (el_private) {
|
||||||
struct element_listener *l;
|
struct element_listener *l;
|
||||||
|
dom_node *el = (dom_node *)el_private->node;
|
||||||
|
|
||||||
|
if (el) {
|
||||||
|
dom_node_unref(el);
|
||||||
|
}
|
||||||
|
|
||||||
foreach(l, el_private->listeners) {
|
foreach(l, el_private->listeners) {
|
||||||
mem_free_set(&l->typ, NULL);
|
mem_free_set(&l->typ, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user