Skip to content

Commit

Permalink
Fix use-after-free in WorkerThreadPool
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinhochun committed Jul 27, 2024
1 parent e343dbb commit 795198a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/object/worker_thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ void WorkerThreadPool::_process_task(Task *p_task) {
}
#endif

bool low_priority = p_task->low_priority;

if (p_task->group) {
// Handling a group
bool do_post = false;
Expand Down Expand Up @@ -159,7 +161,7 @@ void WorkerThreadPool::_process_task(Task *p_task) {
#ifdef THREADS_ENABLED
{
curr_thread.current_task = prev_task;
if (p_task->low_priority) {
if (low_priority) {
low_priority_threads_used--;

if (_try_promote_low_priority_task()) {
Expand Down

0 comments on commit 795198a

Please sign in to comment.