0
0
mirror of https://github.com/rkd77/elinks.git synced 2025-09-21 19:46:23 -04:00

Document how timer callbacks erase timer IDs; add some assertions.

Tangential to bug 868.
This commit is contained in:
Kalle Olavi Niemitalo
2006-12-02 18:35:03 +02:00
committed by Kalle Olavi Niemitalo
parent 5537a3f977
commit bddafe5f7e
14 changed files with 81 additions and 5 deletions

View File

@@ -303,6 +303,9 @@ ecmascript_set_action(unsigned char **action, unsigned char *string)
}
}
/* Timer callback for @interpreter->vs->doc_view->document->timeout.
* As explained in @install_timer, this function must erase the
* expired timer ID from all variables. */
static void
ecmascript_timeout_handler(void *i)
{
@@ -310,6 +313,7 @@ ecmascript_timeout_handler(void *i)
assertm(interpreter->vs->doc_view, "setTimeout: vs with no document (e_f %d)", interpreter->vs->ecmascript_fragile);
interpreter->vs->doc_view->document->timeout = TIMER_ID_UNDEF;
/* The expired timer ID has now been erased. */
ecmascript_eval(interpreter, &interpreter->code, NULL);
}