[file-collection] restore progress after move nulls out pointer

This commit is contained in:
Timothy Stack 2022-06-03 07:06:07 -07:00
parent 1dade3d66e
commit 24a56042d0
3 changed files with 4 additions and 1 deletions

View File

@ -300,6 +300,8 @@ file_collection::watch_logfile(const std::string& filename,
return lnav::futures::make_ready_future(std::move(retval));
}
require(this->fc_progress.get() != nullptr);
auto func = [filename,
st,
loo2 = std::move(loo),

View File

@ -404,7 +404,7 @@ files_overlay_source::list_value_for_overlay(const listview_curses& lv,
constexpr size_t PROG_SIZE = sizeof(PROG) - 1;
auto& fc = lnav_data.ld_active_files;
auto& fc_prog = fc.fc_progress;
auto fc_prog = fc.fc_progress;
safe::WriteAccess<safe_scan_progress> sp(*fc_prog);
if (!sp->sp_extractions.empty()) {

View File

@ -1328,6 +1328,7 @@ looper()
{
active_copy.clear();
active_copy.merge(lnav_data.ld_active_files);
active_copy.fc_progress = lnav_data.ld_active_files.fc_progress;
rescan_future = std::async(std::launch::async,
&file_collection::rescan_files,
std::move(active_copy),