Merge branch 'master' of https://github.com/fasiondog/hikyuu into feature/se

This commit is contained in:
fasiondog 2024-06-01 14:43:12 +08:00
commit 992d5b6119
3 changed files with 10 additions and 2 deletions

View File

@ -34,6 +34,9 @@
// 启用MSVC内存泄漏检查
#define ENABLE_MSVC_LEAK_DETECT ${ENABLE_MSVC_LEAK_DETECT}
// 启用内存泄漏检测,用于 linux 系统
#define HKU_ENABLE_LEAK_DETECT ${HKU_ENABLE_LEAK_DETECT}
// 启用发送用户使用信息
#define HKU_ENABLE_SEND_FEEDBACK ${HKU_ENABLE_SEND_FEEDBACK}

View File

@ -84,6 +84,12 @@ void GlobalInitializer::clean() {
getLatestVersion(), getLatestVersion());
}
#if !HKU_ENABLE_LEAK_DETECT && not defined(MSVC_LEAKER_DETECT)
// 未启用内存泄漏检测时,直接退出,让系统自行释放全部资源
fmt::print("Quit Hikyuu system!\n\n");
return;
#endif
releaseGlobalTaskGroup();
releaseScheduler();
releaseGlobalSpotAgent();
@ -92,8 +98,6 @@ void GlobalInitializer::clean() {
StockManager::quit();
DataDriverFactory::release();
nng_closeall();
#if HKU_ENABLE_HDF5_KDATA
H5close();
#endif

View File

@ -148,6 +148,7 @@ set_configvar("SUPPORT_TEXT_ARCHIVE", 0)
set_configvar("SUPPORT_XML_ARCHIVE", 1)
set_configvar("SUPPORT_BINARY_ARCHIVE", 1)
set_configvar("ENABLE_MSVC_LEAK_DETECT", 0)
set_configvar("HKU_ENABLE_LEAK_DETECT", get_config("leak_check") and 1 or 0)
set_configvar("HKU_ENABLE_SEND_FEEDBACK", get_config("feedback") and 1 or 0)
set_configvar("HKU_ENABLE_HDF5_KDATA", get_config("hdf5") and 1 or 0)