diff --git a/src/xrt/state_trackers/oxr/oxr_instance.c b/src/xrt/state_trackers/oxr/oxr_instance.c index b5c60806a..e93bff144 100644 --- a/src/xrt/state_trackers/oxr/oxr_instance.c +++ b/src/xrt/state_trackers/oxr/oxr_instance.c @@ -44,7 +44,7 @@ extern void oxr_sdl2_hack_start(void *hack, struct xrt_prober *xp); extern void -oxr_sdl2_hack_stop(void *hack); +oxr_sdl2_hack_stop(void **hack_ptr); /* ---- HACK ---- */ static inline int32_t @@ -72,7 +72,7 @@ oxr_instance_destroy(struct oxr_logger *log, struct oxr_handle_base *hb) } /* ---- HACK ---- */ - oxr_sdl2_hack_stop(inst->hack); + oxr_sdl2_hack_stop(&inst->hack); /* ---- HACK ---- */ xrt_prober_destroy(&inst->prober); diff --git a/src/xrt/targets/openxr/oxr_sdl2_hack.c b/src/xrt/targets/openxr/oxr_sdl2_hack.c index bcdcb4ad7..80d339336 100644 --- a/src/xrt/targets/openxr/oxr_sdl2_hack.c +++ b/src/xrt/targets/openxr/oxr_sdl2_hack.c @@ -30,7 +30,7 @@ oxr_sdl2_hack_start(void *hack, struct xrt_prober *xp) {} void -oxr_sdl2_hack_stop(void *hack) +oxr_sdl2_hack_stop(void **hack) {} #else @@ -277,9 +277,9 @@ oxr_sdl2_hack_start(void *hack, struct xrt_prober *xp) } void -oxr_sdl2_hack_stop(void *hack) +oxr_sdl2_hack_stop(void **hack_ptr) { - struct sdl2_program *p = (struct sdl2_program *)hack; + struct sdl2_program *p = *(struct sdl2_program **)hack_ptr; if (p == NULL) { return; } @@ -291,5 +291,6 @@ oxr_sdl2_hack_stop(void *hack) os_thread_helper_destroy(&p->oth); free(p); + *hack_ptr = NULL; } #endif