Merge pull request #67441 from Zylann/fix_tileset_editor_mutex

Fix case where mutex is never unlocked
This commit is contained in:
Rémi Verschelde 2022-10-17 17:30:44 +02:00
commit a9114c602b
1 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,9 @@ void TilesEditorPlugin::_thread() {
pattern_preview_sem.wait(); pattern_preview_sem.wait();
pattern_preview_mutex.lock(); pattern_preview_mutex.lock();
if (pattern_preview_queue.size()) { if (pattern_preview_queue.size() == 0) {
pattern_preview_mutex.unlock();
} else {
QueueItem item = pattern_preview_queue.front()->get(); QueueItem item = pattern_preview_queue.front()->get();
pattern_preview_queue.pop_front(); pattern_preview_queue.pop_front();
pattern_preview_mutex.unlock(); pattern_preview_mutex.unlock();
@ -130,8 +132,6 @@ void TilesEditorPlugin::_thread() {
item.callback.callp(args_ptr, 2, r, error); item.callback.callp(args_ptr, 2, r, error);
viewport->queue_delete(); viewport->queue_delete();
} else {
pattern_preview_mutex.unlock();
} }
} }
} }