Memory Leaks found in boost logger C++

I have a client/server app, I’m using Dr.Memory to debug and find mem leaks. The issue is that there are too many from the logger i’ve created for my application. Find the minimum reproducible example below –

Logging Test:

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE "LoggingTest"

// Setting this to 0x0602 (Windows 8) or higher will cause linking to fail.
// It works with 0x0601 (Windows 7).
#define  _WIN32_WINNT   0x0602

#include <boost/test/unit_test.hpp>
#include <boost/log/core.hpp>
#include <boost/log/trivial.hpp>
#include <boost/log/expressions.hpp>
#include <boost/log/sinks/text_file_backend.hpp>
#include <boost/log/utility/setup/file.hpp>
#include <boost/log/utility/setup/common_attributes.hpp>
#include <boost/log/sources/severity_logger.hpp>
#include <boost/log/sources/record_ostream.hpp>

namespace logging = boost::log;
namespace src = boost::log::sources;
namespace sinks = boost::log::sinks;
namespace keywords = boost::log::keywords;

#if 0

//[ example_tutorial_file_simple
void init()
{
    logging::add_file_log("sample.log");

    logging::core::get()->set_filter
    (
        logging::trivial::severity >= logging::trivial::info
    );
}
//]

// We need this due to this bug: https://svn.boost.org/trac/boost/ticket/4416
//[ example_tutorial_file_advanced_no_callouts
void init()
{
    logging::add_file_log
    (
        keywords::file_name = "sample_%N.log",
        keywords::rotation_size = 10 * 1024 * 1024,
        keywords::time_based_rotation = sinks::file::rotation_at_time_point(0, 0, 0),
        keywords::format = "[%TimeStamp%]: %Message%"
    );

    logging::core::get()->set_filter
    (
        logging::trivial::severity >= logging::trivial::info
    );
}
//]

#else

//[ example_tutorial_file_advanced
void init()
{
    logging::add_file_log
    (
        keywords::file_name = "sample_%N.log",                                        /*< file name pattern >*/
        keywords::rotation_size = 10 * 1024 * 1024,                                   /*< rotate files every 10 MiB... >*/
        keywords::time_based_rotation = sinks::file::rotation_at_time_point(0, 0, 0), /*< ...or at midnight >*/
        keywords::format = "[%TimeStamp%]: %Message%"                                 /*< log record format >*/
    );

    logging::core::get()->set_filter
    (
        logging::trivial::severity >= logging::trivial::info
    );
}
//]

#endif

BOOST_AUTO_TEST_CASE(LoggingTest)
{
    init();
    logging::add_common_attributes();

    using namespace logging::trivial;
    src::severity_logger< severity_level > lg;

    BOOST_LOG_SEV(lg, trace) << "A trace severity message";
    BOOST_LOG_SEV(lg, debug) << "A debug severity message";
    BOOST_LOG_SEV(lg, info) << "An informational severity message";
    BOOST_LOG_SEV(lg, warning) << "A warning severity message";
    BOOST_LOG_SEV(lg, error) << "An error severity message";
    BOOST_LOG_SEV(lg, fatal) << "A fatal severity message";
}

These cause many leaks as shown below:

# 0 replace_operator_new                                                       [D:adrmemorydrmemorycommonalloc_replace.c:2903]
# 1 boost_log-vc143-mt-gd-x64-1_84.d!std::_Default_allocate_traits::_Allocate  [C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.36.32532includexmemory:77]
# 2 boost_log-vc143-mt-gd-x64-1_84.d!std::basic_string<>::basic_string<>       [C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.36.32532includexstring:2577]
# 3 boost_log-vc143-mt-gd-x64-1_84.d!boost::system::detail::generic_error_category_message [C:vcpkginstalledx64-windowsincludeboostsystemdetailgeneric_category_message.hpp:68]
# 4 boost_log-vc143-mt-gd-x64-1_84.d!boost::system::detail::generic_error_category::message [C:vcpkginstalledx64-windowsincludeboostsystemdetailgeneric_category.hpp:65]
# 5 boost_filesystem-vc143-mt-gd-x64!boost::filesystem::detail::path_algorithms::compare_v4+0xbeb1   (0x00007ffd7d94e582 <boost_filesystem-vc143-mt-gd-x64+0xe582>)
# 6 boost_filesystem-vc143-mt-gd-x64!boost::filesystem::detail::path_algorithms::compare_v4+0xa09b   (0x00007ffd7d94c76c <boost_filesystem-vc143-mt-gd-x64+0xc76c>)
# 7 boost_filesystem-vc143-mt-gd-x64!boost::filesystem::detail::path_algorithms::compare_v4+0x686c   (0x00007ffd7d948f3d <boost_filesystem-vc143-mt-gd-x64+0x8f3d>)
# 8 boost_log-vc143-mt-gd-x64-1_84.d!boost::log::v2_mt_nt62::sinks::text_file_backend::consume [C:vcpkgbuildtreesboost-logsrcost-1.84.0-de692694bc.cleansrctext_file_backend.cpp:1496]
# 9 boost::log::v2_mt_nt62::sinks::basic_formatting_sink_frontend<>::feed_record<> [C:vcpkginstalledx64-windowsincludeboostlogsinksbasic_sink_frontend.hpp:465]
#10 boost::log::v2_mt_nt62::sinks::basic_formatting_sink_frontend<>::try_feed_record<> [C:vcpkginstalledx64-windowsincludeboostlogsinksbasic_sink_frontend.hpp:509]
#11 boost::log::v2_mt_nt62::sinks::synchronous_sink<>::try_consume             [C:vcpkginstalledx64-windowsincludeboostlogsinkssync_frontend.hpp:160]

Invalid Heap Argument

# 0 replace_operator_delete_nothrow                                            [D:adrmemorydrmemorycommonalloc_replace.c:2978]
# 1 boost_log-vc143-mt-gd-x64-1_84.d!operator delete                           [D:a_work1ssrcvctoolscrtvcstartupsrcheapdelete_scalar_size.cpp:31]
# 2 boost_log-vc143-mt-gd-x64-1_84.d!boost::filesystem::path::~path  
# 3 boost_log-vc143-mt-gd-x64-1_84.d!boost::log::v2_mt_nt62::core::implementation::~implementation
# 4 boost_log-vc143-mt-gd-x64-1_84.d!boost::log::v2_mt_nt62::core::implementation::`scalar deleting destructor'
# 5 boost_log-vc143-mt-gd-x64-1_84.d!boost::log::v2_mt_nt62::core::~core       [C:vcpkgbuildtreesboost-logsrcost-1.84.0-de692694bc.cleansrccore.cpp:495]
# 6 boost_log-vc143-mt-gd-x64-1_84.d!boost::log::v2_mt_nt62::core::`scalar deleting destructor'
# 7 boost_log-vc143-mt-gd-x64-1_84.d!boost::checked_delete<>                   [C:vcpkginstalledx64-windowsincludeboostcorechecked_delete.hpp:44]
# 8 boost_log-vc143-mt-gd-x64-1_84.d!boost::detail::sp_counted_impl_p<>::dispose [C:vcpkginstalledx64-windowsincludeboostsmart_ptrdetailsp_counted_impl.hpp:89]
# 9 boost_log-vc143-mt-gd-x64-1_84.d!boost::detail::sp_counted_base::release   [C:vcpkginstalledx64-windowsincludeboostsmart_ptrdetailsp_counted_base_std_atomic.hpp:119]
#10 boost_log-vc143-mt-gd-x64-1_84.d!boost::detail::shared_count::~shared_count [C:vcpkginstalledx64-windowsincludeboostsmart_ptrdetailshared_count.hpp:432]
#11 boost_log-vc143-mt-gd-x64-1_84.d!boost::shared_ptr<>::~shared_ptr<>
#12 boost_log-vc143-mt-gd-x64-1_84.d!`boost::log::v2_mt_nt62::aux::lazy_singleton<>::get_instance'::`2'::`dynamic atexit destructor for 'instance''
#13 ucrtbased.dll!initterm_e                                                  +0x960    (0x00007ffcb4c72931 <ucrtbased.dll+0xb2931>)
#14 ucrtbased.dll!initterm_e                                                  +0x134    (0x00007ffcb4c72105 <ucrtbased.dll+0xb2105>)
#15 ucrtbased.dll!initterm_e                                                  +0x286    (0x00007ffcb4c72257 <ucrtbased.dll+0xb2257>)
#16 ucrtbased.dll!execute_onexit_table                                        +0x33     (0x00007ffcb4c72b44 <ucrtbased.dll+0xb2b44>)
#17 boost_log-vc143-mt-gd-x64-1_84.d!__scrt_dllmain_uninitialize_c             [D:a_work1ssrcvctoolscrtvcstartupsrcutilityutility.cpp:398]
#18 boost_log-vc143-mt-gd-x64-1_84.d!dllmain_crt_process_detach                [D:a_work1ssrcvctoolscrtvcstartupsrcstartupdll_dllmain.cpp:180]
#19 boost_log-vc143-mt-gd-x64-1_84.d!dllmain_crt_dispatch                      [D:a_work1ssrcvctoolscrtvcstartupsrcstartupdll_dllmain.cpp:220]
Note: @0:00:09.015 in thread 24940
Note: refers to -1 byte(s) before next malloc
Note: next higher malloc: 0x00000252809ec690-0x00000252809ec6e0
Note: refers to -80 byte(s) beyond last valid byte in prior malloc
Note: prev lower malloc:  0x00000252809ec690-0x00000252809ec6e0

What can I do to rid of these bugs?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật