Wed, 05 Jun 2024 19:50:44 +0200
add extra nullptr check in the event loop to handle the case when the finish ptr is set to NULL after it was already scheduled
--- a/src/server/daemon/event_bsd.c Wed Jun 05 19:49:17 2024 +0200 +++ b/src/server/daemon/event_bsd.c Wed Jun 05 19:50:44 2024 +0200 @@ -143,7 +143,10 @@ // call event finish handlers for(int i=0;i<numfinished;i++) { Event *event = finished[i]; - finished[i]->finish(ev, event); + // check again if the finish callback is set + if(finished[i]->finish) { + finished[i]->finish(ev, event); + } } // execute return calls for(int i=0;i<ev->numret;i++) {
--- a/src/server/daemon/event_linux.c Wed Jun 05 19:49:17 2024 +0200 +++ b/src/server/daemon/event_linux.c Wed Jun 05 19:50:44 2024 +0200 @@ -171,7 +171,10 @@ // call event finish handlers for(int i=0;i<numfinished;i++) { Event *event = finished[i]; - finished[i]->finish(ev, event); + // check again if the finish callback is set + if(finished[i]->finish) { + finished[i]->finish(ev, event); + } } // execute return calls for(int i=0;i<ev->numret;i++) {
--- a/src/server/daemon/event_solaris.c Wed Jun 05 19:49:17 2024 +0200 +++ b/src/server/daemon/event_solaris.c Wed Jun 05 19:50:44 2024 +0200 @@ -124,7 +124,10 @@ // call event finish handlers for(int i=0;i<numfinished;i++) { Event *event = finished[i]; - finished[i]->finish(ev, event); + // check again if the finish callback is set + if(finished[i]->finish) { + finished[i]->finish(ev, event); + } } // execute return calls for(int i=0;i<ev->numret;i++) {