diff --git a/repertory/librepertory/src/file_manager/open_file.cpp b/repertory/librepertory/src/file_manager/open_file.cpp index ccd7a090..a93ba299 100644 --- a/repertory/librepertory/src/file_manager/open_file.cpp +++ b/repertory/librepertory/src/file_manager/open_file.cpp @@ -558,17 +558,18 @@ void open_file::update_background_reader(std::size_t read_chunk) { } io_thread_notify_.notify_all(); io_lock.unlock(); - } else { - do { - next_chunk = read_chunk_ = - ((read_chunk_ + 1U) >= read_state_.size()) ? 0U - : read_chunk_ + 1U; - } while ((next_chunk != 0U) && (active_downloads_.find(next_chunk) != - active_downloads_.end())); - - file_lock.unlock(); - download_chunk(next_chunk, true, false); + continue; } + + do { + next_chunk = read_chunk_ = ((read_chunk_ + 1U) >= read_state_.size()) + ? 0U + : read_chunk_ + 1U; + } while ((next_chunk != 0U) && (active_downloads_.find(next_chunk) != + active_downloads_.end())); + + file_lock.unlock(); + download_chunk(next_chunk, true, false); } }); }