Unref body when finished getting event handler

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2019-05-04 15:01:05 +01:00
parent 99809ee646
commit e4f57437f6
1 changed files with 4 additions and 0 deletions

View File

@ -1343,10 +1343,14 @@ bool js_fire_event(jscontext *ctx, const char *type, struct dom_document *doc, s
/* ... handlers bodynode */
if (dukky_get_current_value_of_event_handler(
CTX, corestring_dom_load, body) == false) {
/* Unref the body, we don't need it any more */
dom_node_unref(body);
/* ... handlers */
duk_pop(CTX);
return true;
}
/* Unref the body, we don't need it any more */
dom_node_unref(body);
/* ... handlers handler bodynode */
duk_pop(CTX);
}