Give a network task's system event back to the event table before its record is freed. The table counts entries in host memory as live, so each task the game destroyed kept a slot for the rest of the run, and enough of them would fill it. Not reproduced before the change; system_event_check passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 18:46:50 -05:00
parent 52d996d4aa
commit d9940113ef

View File

@@ -333,7 +333,11 @@ static void ov_clock_task_ctor(Cpu *c) { *(void **)arg_p(c, 0) = NULL; }
static void ov_task_dtor(Cpu *c) {
void **slot = arg_p(c, 0);
if (slot && *slot) {
free(*slot); // the bound SystemEventType's kernel handles stay (as for any undestroyed guest event)
HostTask *t = *slot;
// The event lives in this record: its entry in the system-event table goes back before the record is freed,
// or the table would count it live for the rest of the run (kernel.c kern_unbind_system_event)
if (t->bound) kern_unbind_system_event(c, (uint64_t)(uintptr_t)t->event);
free(t);
*slot = NULL;
}
}