Skip to content

Commit

Permalink
Merge pull request #67441 from Zylann/fix_tileset_editor_mutex
Browse files Browse the repository at this point in the history
Fix case where mutex is never unlocked
  • Loading branch information
akien-mga committed Oct 17, 2022
2 parents 00d44a9 + 9efb2e7 commit a9114c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions editor/plugins/tiles/tiles_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ void TilesEditorPlugin::_thread() {
pattern_preview_sem.wait();

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();
pattern_preview_queue.pop_front();
pattern_preview_mutex.unlock();
Expand Down Expand Up @@ -130,8 +132,6 @@ void TilesEditorPlugin::_thread() {
item.callback.callp(args_ptr, 2, r, error);

viewport->queue_delete();
} else {
pattern_preview_mutex.unlock();
}
}
}
Expand Down

0 comments on commit a9114c6

Please sign in to comment.