From 7d08244204ff3db78586f2eba73356cffcb6c6ec Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 5 Jan 2017 08:56:16 +0100 Subject: [PATCH] Prevent crash when togglign between thraded and non-threaded video --- libretro-common/queues/task_queue.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libretro-common/queues/task_queue.c b/libretro-common/queues/task_queue.c index f228441280..267c2bd01a 100644 --- a/libretro-common/queues/task_queue.c +++ b/libretro-common/queues/task_queue.c @@ -55,6 +55,7 @@ struct retro_task_impl void (*deinit)(void); }; +static retro_task_queue_msg_t msg_push_bak; static task_queue_t tasks_running = {NULL, NULL}; static task_queue_t tasks_finished = {NULL, NULL}; @@ -555,6 +556,8 @@ void task_queue_init(bool threaded, retro_task_queue_msg_t msg_push) } #endif + msg_push_bak = msg_push; + impl_current->msg_push = msg_push; impl_current->init(); } @@ -598,7 +601,7 @@ bool task_queue_ctl(enum task_queue_ctl_state state, void *data) task_queue_deinit(); if (!impl_current) - task_queue_init(want_threaded, impl_current->msg_push); + task_queue_init(want_threaded, msg_push_bak); #endif impl_current->gather();