Skip to content

Commit 0025f65

Browse files
committed
Fix logging signal handling and duplicate declaration
1 parent b18c903 commit 0025f65

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎httpd/include/httpd/logging.hpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,9 @@ static LONG WINAPI unexpectedExceptionHandling(EXCEPTION_POINTERS* e)
13071307

13081308
inline void signal_handler(int)
13091309
{
1310-
global_logger_obj___.reset();
1310+
// 只置位停止标志,避免在信号处理函数中析构(join)日志线程.
1311+
if (auto obj = global_logger_obj___)
1312+
obj->stop();
13111313
}
13121314

13131315
inline void init_logging(const std::string& path = "")
@@ -1916,7 +1918,6 @@ class empty_logger___
19161918
namespace xlogger {
19171919
inline void init_logging(const std::string& path/* = ""*/);
19181920
inline std::string log_path();
1919-
inline std::string log_path();
19201921
inline void shutdown_logging();
19211922
inline void turnoff_logging() noexcept;
19221923
inline void turnon_logging() noexcept;

0 commit comments

Comments
 (0)