From dddc5eac944746b766ac1009d2b7063cabab0d3d Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 8 Jun 2019 13:33:16 +0100 Subject: Update schedulers return codes The GTK and monkey frontends schedulers now return NSERROR_NOT_FOUND when a caller is using a negative schedule time to remove a callback. --- content/handlers/javascript/duktape/Window.bnd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'content/handlers/javascript') diff --git a/content/handlers/javascript/duktape/Window.bnd b/content/handlers/javascript/duktape/Window.bnd index 865d07421..99615c207 100644 --- a/content/handlers/javascript/duktape/Window.bnd +++ b/content/handlers/javascript/duktape/Window.bnd @@ -167,10 +167,15 @@ static size_t window_alloc_new_callback(duk_context *ctx, window_private_t *wind static void window_remove_callback_by_handle(duk_context *ctx, window_private_t *window, size_t handle) { + int res; + RING_ITERATE_START(window_schedule_t, window->schedule_ring, sched) { if (sched->handle == handle) { NSLOG(dukky, DEEPDEBUG, "Cancelled callback %"PRIsizet, sched->handle); - guit->misc->schedule(-1, window_schedule_callback, sched); + res = guit->misc->schedule(-1, + window_schedule_callback, + sched); + assert(res == NSERROR_OK); RING_REMOVE(window->schedule_ring, sched); window_remove_callback_bits(ctx, sched->handle); free(sched); -- cgit v1.2.3