st/oxr: Improve destruction of GUI hack

This commit is contained in:
Jakob Bornecrantz 2019-11-09 12:44:59 +00:00
parent 86244f726f
commit a29dd8c0a4
2 changed files with 6 additions and 5 deletions

View file

@ -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);

View file

@ -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