From c614be0613a4aae683d55779c67e50fdcdce33fe Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Fri, 18 Nov 2022 11:56:03 +0100 Subject: [PATCH] :bug: Fix Event.signal --- src/lib/event.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/event.c b/src/lib/event.c index eb7fe511..c21d3b9d 100644 --- a/src/lib/event.c +++ b/src/lib/event.c @@ -31,12 +31,11 @@ static INSTR(EventWait) { static MFUN(event_signal) { const Vector v = &EV_SHREDS(o); - const VM_Shred sh = (VM_Shred)vector_front(v); - if (sh) { - shredule(sh->tick->shreduler, sh, GWION_EPSILON); - vector_rem(v, 0); - release(sh->info->me, sh); - } + if(!vector_size(v)) return; + const VM_Shred sh = vector_front(v); + shredule(sh->tick->shreduler, sh, GWION_EPSILON); + vector_rem(v, 0); + release(sh->info->me, sh); } ANN void broadcast(const M_Object o) { -- 2.43.0