@@ -164,6 +164,8 @@ using namespace md4cpp::literals;
164164static std::vector<std::string> DEFAULT_FILES ;
165165static auto intern_lifetime = intern_string::get_table_lifetime();
166166
167+ static std::vector<std::future<void >> CLEANUP_TASKS ;
168+
167169constexpr std::chrono::microseconds ZOOM_LEVELS [] = {
168170 1s,
169171 30s,
@@ -2339,11 +2341,13 @@ VALUES ('org.lnav.mouse-support', -1, DATETIME('now', '+1 minute'),
23392341 }
23402342
23412343 if (!ran_cleanup) {
2342- line_buffer::cleanup_cache ();
2343- archive_manager::cleanup_cache ();
2344- tailer::cleanup_cache ();
2345- lnav::piper::cleanup ();
2346- file_converter_manager::cleanup ();
2344+ CLEANUP_TASKS .emplace_back (line_buffer::cleanup_cache ());
2345+ CLEANUP_TASKS .emplace_back (
2346+ archive_manager::cleanup_cache ());
2347+ CLEANUP_TASKS .emplace_back (tailer::cleanup_cache ());
2348+ CLEANUP_TASKS .emplace_back (lnav::piper::cleanup ());
2349+ CLEANUP_TASKS .emplace_back (
2350+ file_converter_manager::cleanup ());
23472351 ran_cleanup = true ;
23482352 }
23492353 }
@@ -3997,11 +4001,11 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'
39974001
39984002 log_info (" Executing initial commands" );
39994003 execute_init_commands (lnav_data.ld_exec_context , cmd_results);
4000- archive_manager ::cleanup_cache ();
4001- tailer ::cleanup_cache ();
4002- line_buffer ::cleanup_cache ();
4003- lnav::piper::cleanup ();
4004- file_converter_manager::cleanup ();
4004+ CLEANUP_TASKS . emplace_back ( line_buffer ::cleanup_cache () );
4005+ CLEANUP_TASKS . emplace_back ( archive_manager ::cleanup_cache () );
4006+ CLEANUP_TASKS . emplace_back ( tailer ::cleanup_cache () );
4007+ CLEANUP_TASKS . emplace_back ( lnav::piper::cleanup () );
4008+ CLEANUP_TASKS . emplace_back ( file_converter_manager::cleanup () );
40054009 wait_for_pipers ();
40064010 rescan_files (true );
40074011 isc::to<curl_looper&, services::curl_streamer_t >()
0 commit comments