Skip to content

Commit c9f4436

Browse files
alvinhochunakien-mga
authored andcommitted
Fix use-after-free in WorkerThreadPool
1 parent 88d9325 commit c9f4436

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/object/worker_thread_pool.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ void WorkerThreadPool::_process_task(Task *p_task) {
8383
}
8484
#endif
8585

86+
#ifdef THREADS_ENABLED
87+
bool low_priority = p_task->low_priority;
88+
#endif
89+
8690
if (p_task->group) {
8791
// Handling a group
8892
bool do_post = false;
@@ -159,7 +163,7 @@ void WorkerThreadPool::_process_task(Task *p_task) {
159163
#ifdef THREADS_ENABLED
160164
{
161165
curr_thread.current_task = prev_task;
162-
if (p_task->low_priority) {
166+
if (low_priority) {
163167
low_priority_threads_used--;
164168

165169
if (_try_promote_low_priority_task()) {

0 commit comments

Comments
 (0)