1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

Fix reinitialization of the threaded gl drivers

This commit is contained in:
Viačasłaŭ Chalikin 2024-05-26 12:47:29 +03:00 committed by LibretroAdmin
parent c4f84094c2
commit 1e9db89154
2 changed files with 10 additions and 8 deletions

View File

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

View File

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