Skip to content

Commit ce1eb62

Browse files
committed
Fix ASAN failures
1 parent 8d46211 commit ce1eb62

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/logger.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,11 @@ inline void Logger::shutdown(bool clear_sinks) {
17161716
}
17171717

17181718
if (clear_sinks) {
1719-
// Clear sinks to release file handles and other resources
1719+
// Clear sinks to release file handles and other resources.
1720+
// sinkname_index_map_ holds string_view keys that point into the name
1721+
// strings owned by each sink object — it must be cleared first so no
1722+
// dangling views remain after the sink shared_ptrs are destroyed.
1723+
sinkname_index_map_.clear();
17201724
sinks_.clear();
17211725
}
17221726
log_queue_.reset();

0 commit comments

Comments
 (0)