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

[css] More dom_node_unref

Subsequent calls to el_match_selector cause memleak.
Need to resolve it.
This commit is contained in:
Witold Filipczyk 2024-08-11 18:51:51 +02:00
parent d805d4bdbf
commit 50401d3055

View File

@ -510,6 +510,10 @@ css_error named_ancestor_node(void *pw, void *node,
{
dom_element_named_ancestor_node(node, qname->name,
(struct dom_element **)ancestor);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(*ancestor);
return CSS_OK;
}
@ -530,6 +534,9 @@ css_error named_parent_node(void *pw, void *node,
{
dom_element_named_parent_node(node, qname->name,
(struct dom_element **)parent);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(*parent);
return CSS_OK;
@ -710,6 +717,9 @@ fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
css_error parent_node(void *pw, void *node, void **parent)
{
dom_element_parent_node(node, (struct dom_element **)parent);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(*parent);
return CSS_OK;
@ -2502,7 +2512,6 @@ el_match_selector(const char *selector, void *node)
}
empty:
css_libcss_node_data_handler(&selection_handler, CSS_NODE_DELETED, NULL, node, NULL, NULL);
if (style) {
css_select_results_destroy(style);