--- lbbs/src/main.c 2025/11/18 15:38:49 1.82 +++ lbbs/src/main.c 2025/11/21 08:59:29 1.85 @@ -173,11 +173,13 @@ int main(int argc, char *argv[]) return -2; } +#ifndef __MSYS__ // Load BWF config if (bwf_load(CONF_BWF) < 0) { return -2; } +#endif // Check article cache dir ret = mkdir(VAR_ARTICLE_CACHE_DIR, 0750); @@ -246,22 +248,17 @@ int main(int argc, char *argv[]) // Load menus if (load_menu(&bbs_menu, CONF_MENU) < 0) { - log_error("load_menu(%s) error\n", CONF_MENU); + log_error("load_menu(bbs_menu) error\n"); goto cleanup; } if (load_menu(&top10_menu, CONF_TOP10_MENU) < 0) { - log_error("load_menu(%s) error\n", CONF_TOP10_MENU); + log_error("load_menu(top10_menu) error\n"); goto cleanup; } top10_menu.allow_exit = 1; // Load data files - if (file_loader_init() < 0) - { - log_error("file_loader_init() error\n"); - goto cleanup; - } for (int i = 0; i < data_files_load_startup_count; i++) { if (load_file(data_files_load_startup[i]) < 0) @@ -384,7 +381,13 @@ cleanup: } // Cleanup loaded data files - file_loader_cleanup(); + for (int i = 0; i < data_files_load_startup_count; i++) + { + if (unload_file(data_files_load_startup[i]) < 0) + { + log_error("unload_file(%s) error\n", data_files_load_startup[i]); + } + } // Cleanup menu unload_menu(&bbs_menu); @@ -396,8 +399,10 @@ cleanup: trie_dict_cleanup(); user_list_pool_cleanup(); +#ifndef __MSYS__ // Cleanup BWF bwf_unload(); +#endif if (unlink(VAR_ARTICLE_BLOCK_SHM) < 0) {