mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 10:19:47 -04:00
facdf01ac6
Review (#599): who keeps the callback context alive until render-thread calls are quiescent. Draw calls now run inside an in-flight count, and set_draw_cb (replace or NULL) swaps the record and waits until no call that read the old one is running, then frees it. When it returns, the registrant may free ctx and its GL objects; it must unregister before destroying them or the context. A change from inside the callback does not wait. Documented in host_overlay.h. Tests: a reader thread drawing while the owner unregisters and frees (300 rounds; fails without the wait), and self-unregister from the callback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>