mirror of
https://github.com/rkd77/elinks.git
synced 2025-09-21 19:46:23 -04:00
952, 954: Add ecmascript_detach_form_view stub
Anything that frees struct form_view must now call the new function ecmascript_detach_form_view. This function should then clear out any dangling pointers, but that has not yet been implemented.
This commit is contained in:
committed by
Kalle Olavi Niemitalo
parent
bbadb99dd1
commit
759fbb1142
@@ -214,6 +214,16 @@ ecmascript_eval_boolback(struct ecmascript_interpreter *interpreter,
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
ecmascript_detach_form_view(struct form_view *fv)
|
||||
{
|
||||
#ifdef CONFIG_ECMASCRIPT_SEE
|
||||
see_detach_form_view(fv);
|
||||
#else
|
||||
spidermonkey_detach_form_view(fv);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ecmascript_detach_form_state(struct form_state *fs)
|
||||
{
|
||||
#ifdef CONFIG_ECMASCRIPT_SEE
|
||||
@@ -242,6 +252,8 @@ ecmascript_reset_state(struct view_state *vs)
|
||||
* ecmascript_obj pointers are also NULL. However, they might
|
||||
* be non-NULL if the ECMAScript objects have been lazily
|
||||
* created because of scripts running in sibling HTML frames. */
|
||||
foreach (fv, vs->forms)
|
||||
ecmascript_detach_form_view(fv);
|
||||
for (i = 0; i < vs->form_info_len; i++)
|
||||
ecmascript_detach_form_state(&vs->form_info[i]);
|
||||
|
||||
@@ -249,9 +261,6 @@ ecmascript_reset_state(struct view_state *vs)
|
||||
if (vs->ecmascript)
|
||||
ecmascript_put_interpreter(vs->ecmascript);
|
||||
|
||||
foreach (fv, vs->forms)
|
||||
fv->ecmascript_obj = NULL;
|
||||
|
||||
vs->ecmascript = ecmascript_get_interpreter(vs);
|
||||
if (!vs->ecmascript)
|
||||
vs->ecmascript_fragile = 1;
|
||||
|
Reference in New Issue
Block a user