diff --git a/gfx/drivers/gl2.c b/gfx/drivers/gl2.c index 791ef5c89d..908da40366 100644 --- a/gfx/drivers/gl2.c +++ b/gfx/drivers/gl2.c @@ -5185,11 +5185,13 @@ static int video_texture_unload_wrap_gl2(void *data) { GLuint glid; uintptr_t id = (uintptr_t)data; +#if 0 + /*FIXME: crash on reinit*/ gl2_t *gl = (gl2_t*)video_driver_get_ptr(); if (gl && gl->ctx_driver->make_current) gl->ctx_driver->make_current(false); - +#endif glid = (GLuint)id; glDeleteTextures(1, &glid); return 0; diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index 72e8e0db2d..e4b191ab07 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -363,7 +363,7 @@ static bool video_thread_handle_packet( /* Never reply on no command. Possible deadlock if * thread sends command right after frame update. */ break; - + case CMD_POKE_SET_HDR_MAX_NITS: if (thr->driver_data && thr->poke && thr->poke->set_hdr_max_nits) thr->poke->set_hdr_max_nits( @@ -372,7 +372,7 @@ static bool video_thread_handle_packet( ); video_thread_reply(thr, &pkt); break; - + case CMD_POKE_SET_HDR_PAPER_WHITE_NITS: if (thr->driver_data && thr->poke && thr->poke->set_hdr_paper_white_nits) @@ -382,7 +382,7 @@ static bool video_thread_handle_packet( ); video_thread_reply(thr, &pkt); break; - + case CMD_POKE_SET_HDR_CONTRAST: if (thr->driver_data && thr->poke && thr->poke->set_hdr_contrast) thr->poke->set_hdr_contrast( @@ -391,7 +391,7 @@ static bool video_thread_handle_packet( ); video_thread_reply(thr, &pkt); break; - + case CMD_POKE_SET_HDR_EXPAND_GAMUT: if (thr->driver_data && thr->poke && thr->poke->set_hdr_expand_gamut) thr->poke->set_hdr_expand_gamut( @@ -457,7 +457,7 @@ static void video_thread_loop(void *data) video_frame_info_t video_info; bool ret; - /* TODO/FIXME - not thread-safe - should get + /* TODO/FIXME - not thread-safe - should get * rid of this */ video_driver_build_info(&video_info); @@ -508,7 +508,7 @@ static bool video_thread_alive(void *data) if (!thr) return false; - + runloop_flags = runloop_get_flags(); if (runloop_flags & RUNLOOP_FLAG_PAUSED) @@ -1434,7 +1434,7 @@ unsigned video_thread_texture_handle(void *data, custom_command_method_t func) /* if we're already on the video thread, just call the function, otherwise * we may deadlock with ourself waiting for the packet to be processed. */ - if (sthread_get_thread_id(thr->thread) == sthread_get_current_thread_id()) + if (sthread_get_thread_id(thr->thread) == sthread_get_current_thread_id() || !thr->alive) return func(data); pkt.type = CMD_CUSTOM_COMMAND;