mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
setTimeout: kill previous timer when planting a new one
Otherwise if the page installs multiple timers the old one would live on unreferenced and possibly (likely) trigger after the document's death and everything would go to hell.
This commit is contained in:
parent
74997f772c
commit
da5ec748b6
@ -323,6 +323,7 @@ ecmascript_set_timeout(struct ecmascript_interpreter *interpreter, unsigned char
|
||||
init_string(&interpreter->code);
|
||||
add_to_string(&interpreter->code, code);
|
||||
mem_free(code);
|
||||
kill_timer(&interpreter->vs->doc_view->document->timeout);
|
||||
install_timer(&interpreter->vs->doc_view->document->timeout, timeout, ecmascript_timeout_handler, interpreter);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user