--- lbbs/src/bbs_main.c 2025/06/08 09:25:24 1.68 +++ lbbs/src/bbs_main.c 2025/06/18 02:29:54 1.71 @@ -28,6 +28,7 @@ #include "bbs_cmd.h" #include "section_list.h" #include "trie_dict.h" +#include "editor.h" #include #include #include @@ -196,7 +197,7 @@ int bbs_center() int ch; time_t t_last_action; - BBS_last_access_tm = t_last_action = time(0); + BBS_last_access_tm = t_last_action = time(NULL); clearscr(); @@ -210,9 +211,9 @@ int bbs_center() { ch = igetch(100); - if (p_bbs_menu->choose_step == 0 && time(0) - t_last_action >= 10) + if (p_bbs_menu->choose_step == 0 && time(NULL) - t_last_action >= 10) { - t_last_action = time(0); + t_last_action = time(NULL); show_active_board(); show_bottom(""); @@ -220,12 +221,17 @@ int bbs_center() iflush(); } + if (user_online_update("MENU") < 0) + { + log_error("user_online_update(MENU) error\n"); + } + switch (ch) { case KEY_NULL: // broken pipe return 0; case KEY_TIMEOUT: - if (time(0) - BBS_last_access_tm >= MAX_DELAY_TIME) + if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME) { return 0; } @@ -238,7 +244,7 @@ int bbs_center() case EXITBBS: return 0; case REDRAW: - t_last_action = time(0); + t_last_action = time(NULL); clearscr(); show_top("", BBS_name, ""); show_active_board(); @@ -253,7 +259,7 @@ int bbs_center() iflush(); } - BBS_last_access_tm = time(0); + BBS_last_access_tm = time(NULL); } return 0; @@ -314,6 +320,13 @@ int bbs_main() goto cleanup; } + // Init editor memory pool + if (editor_memory_pool_init() < 0) + { + log_error("editor_memory_pool_init() error\n"); + goto cleanup; + } + clearscr(); // BBS Top 10 @@ -332,6 +345,9 @@ int bbs_main() } cleanup: + // Cleanup editor memory pool + editor_memory_pool_cleanup(); + // Unload article view log article_view_log_unload(&BBS_article_view_log);