Commit a29dd8c0 authored by Jakob Bornecrantz's avatar Jakob Bornecrantz

st/oxr: Improve destruction of GUI hack

parent 86244f72
......@@ -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);
......
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment