diff --git a/src/builtin.cpp b/src/builtin.cpp index 58cf00188..3b6aff970 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -489,9 +489,6 @@ void builtin_init() { } } -/// Destroy builtin data. -void builtin_destroy() {} - /// Is there a builtin command with the given name? bool builtin_exists(const wcstring &cmd) { return static_cast(builtin_lookup(cmd)); } diff --git a/src/builtin.h b/src/builtin.h index 6f7e96d11..58434d7fa 100644 --- a/src/builtin.h +++ b/src/builtin.h @@ -76,7 +76,6 @@ enum { COMMAND_NOT_BUILTIN, BUILTIN_REGULAR, BUILTIN_FUNCTION }; #define FG_MSG _(L"Send job %d, '%ls' to foreground\n") void builtin_init(); -void builtin_destroy(); bool builtin_exists(const wcstring &cmd); int builtin_run(parser_t &parser, const wchar_t *const *argv, io_streams_t &streams); diff --git a/src/event.cpp b/src/event.cpp index 5b8ea051d..12e8c8d54 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -448,10 +448,6 @@ void event_fire(const event_t *event) { } } -void event_init() {} - -void event_destroy() { s_event_handlers.clear(); } - void event_fire_generic(const wchar_t *name, wcstring_list_t *args) { CHECK(name, ); diff --git a/src/event.h b/src/event.h index c08f9866e..6133cfe16 100644 --- a/src/event.h +++ b/src/event.h @@ -125,12 +125,6 @@ void event_fire(const event_t *event); /// May be called from signal handlers void event_fire_signal(int signal); -/// Initialize the event-handling library. -void event_init(); - -/// Destroy the event-handling library. -void event_destroy(); - /// Returns a string describing the specified event. wcstring event_get_desc(const event_t &e); diff --git a/src/fish.cpp b/src/fish.cpp index 9963017d3..4f6035a73 100644 --- a/src/fish.cpp +++ b/src/fish.cpp @@ -376,11 +376,9 @@ int main(int argc, char **argv) { const struct config_paths_t paths = determine_config_directory_paths(argv[0]); env_init(&paths); proc_init(); - event_init(); builtin_init(); misc_init(); reader_init(); - history_init(); parser_t &parser = parser_t::principal_parser(); @@ -448,11 +446,8 @@ int main(int argc, char **argv) { parser.emit_profiling(s_profiling_output_filename); } - history_destroy(); + history_save_all(); proc_destroy(); - builtin_destroy(); - reader_destroy(); - event_destroy(); exit_without_destructors(exit_status); return EXIT_FAILURE; // above line should always exit } diff --git a/src/fish_key_reader.cpp b/src/fish_key_reader.cpp index 00c06276f..aec1626be 100644 --- a/src/fish_key_reader.cpp +++ b/src/fish_key_reader.cpp @@ -299,7 +299,6 @@ static void setup_and_process_keys(bool continuous_mode) { restore_term_mode(); restore_term_foreground_process_group(); input_destroy(); - reader_destroy(); } static bool parse_debug_level_flag() { diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index d11a33b47..3ec041cba 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -4412,7 +4412,6 @@ int main(int argc, char **argv) { set_main_thread(); setup_fork_guards(); proc_init(); - event_init(); builtin_init(); env_init(); misc_init(); @@ -4478,9 +4477,6 @@ int main(int argc, char **argv) { say(L"Encountered %d errors in low-level tests", err_count); if (s_test_run_count == 0) say(L"*** No Tests Were Actually Run! ***"); - reader_destroy(); - builtin_destroy(); - event_destroy(); proc_destroy(); if (err_count != 0) { diff --git a/src/function.h b/src/function.h index 95957a90b..514a3e65a 100644 --- a/src/function.h +++ b/src/function.h @@ -63,9 +63,6 @@ class function_info_t { bool autoload); }; -/// Initialize function data. -void function_init(); - /// Add a function. definition_line_offset is the line number of the function's definition within /// its source file. void function_add(const function_data_t &data, const parser_t &parser, diff --git a/src/history.cpp b/src/history.cpp index 190208eaa..7fea40694 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -1836,8 +1836,6 @@ void history_t::incorporate_external_changes() { } } -void history_init() {} - void history_collection_t::save() { // Save all histories auto &&h = histories.acquire(); @@ -1846,11 +1844,7 @@ void history_collection_t::save() { } } -void history_destroy() { histories.save(); } - -void history_sanity_check() { - // No sanity checking implemented yet... -} +void history_save_all() { histories.save(); } /// Return the prefix for the files to be used for command and read history. wcstring history_session_id() { diff --git a/src/history.h b/src/history.h index da5ec154a..9b411689a 100644 --- a/src/history.h +++ b/src/history.h @@ -358,15 +358,8 @@ class history_search_t { : history(), term(), search_type(HISTORY_SEARCH_TYPE_CONTAINS), case_sensitive(true) {} }; -/// Init history library. The history file won't actually be loaded until the first time a history -/// search is performed. -void history_init(); - /// Saves the new history to disk. -void history_destroy(); - -/// Perform sanity checks. -void history_sanity_check(); +void history_save_all(); /// Return the prefix for the files to be used for command and read history. wcstring history_session_id(); diff --git a/src/reader.cpp b/src/reader.cpp index 6c86c786d..dac8acd2d 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -803,8 +803,6 @@ void reader_init() { get_current_winsize(); } -void reader_destroy() { pthread_key_delete(generation_count_key); } - /// Restore the term mode if we own the terminal. It's important we do this before /// restore_foreground_process_group, otherwise we won't think we own the terminal. void restore_term_mode() { diff --git a/src/reader.h b/src/reader.h index b38ec0454..fe0776907 100644 --- a/src/reader.h +++ b/src/reader.h @@ -58,9 +58,6 @@ void reader_sanity_check(); /// Initialize the reader. void reader_init(); -/// Destroy and free resources used by the reader. -void reader_destroy(); - /// Restore the term mode at startup. void restore_term_mode(); diff --git a/src/sanity.cpp b/src/sanity.cpp index b5c803304..37eeaafee 100644 --- a/src/sanity.cpp +++ b/src/sanity.cpp @@ -20,7 +20,6 @@ void sanity_lose() { } bool sanity_check() { - if (!insane && shell_is_interactive()) history_sanity_check(); if (!insane) reader_sanity_check(); if (!insane) kill_sanity_check(); if (!insane) proc_sanity_check();