From 1c080b5ca821ef6e1d40025289195b18fa2973b5 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期一, 26 一月 2026 22:46:48 +0800
Subject: [PATCH] 1.把 m_bufGlass 的释放提前到 CMaster::term(),确保在 m_glassPool.term() 之前完成,避免析构时再触碰已被回收的 Glass。析构里仍保留原逻辑,若 term() 已清空则不会重复释放。
---
SourceCode/Bond/Servo/Model.cpp | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 6882783..ed29052 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -184,6 +184,7 @@
int CModel::init()
{
+ const ULONGLONG boot_model_begin = GetTickCount64();
CString strIniFile;
CString strUnitId;
strIniFile.Format(_T("%s\\ServoConfiguration.ini"), (LPTSTR)(LPCTSTR)m_strWorkDir);
@@ -214,6 +215,7 @@
CLog::GetLog()->SetLogsDir(strLogDir);
CLog::GetLog()->SetEquipmentId((LPTSTR)(LPCTSTR)strUnitId);
LOGI("\r\n\r\n~~~ Prog Start! ~~~");
+ LOGI("[BOOT][MODEL] init begin");
SECSListener listener;
@@ -419,6 +421,8 @@
}
strVarialbleFile.Format(_T("%s\\HsmsPassive.cache"), (LPTSTR)(LPCTSTR)m_strWorkDir);
m_hsmsPassive.loadCacheFromFile(strVarialbleFile);
+ LOGI("[BOOT][MODEL] HSMS config loaded, cost=%llu ms",
+ (unsigned long long)(GetTickCount64() - boot_model_begin));
SERVO::MasterListener masterListener;
@@ -922,6 +926,8 @@
char szBuffer[MAX_PATH];
sprintf_s(szBuffer, MAX_PATH, "%s\\AlarmList.csv", (LPTSTR)(LPCTSTR)m_strWorkDir);
alarmManager.readAlarmFile(szBuffer);
+ LOGI("[BOOT][MODEL] Alarm list loaded, cost=%llu ms",
+ (unsigned long long)(GetTickCount64() - boot_model_begin));
// Glass鏁版嵁搴�
@@ -930,6 +936,8 @@
GlassLogDb::Init(path);
+ LOGI("[BOOT][MODEL] init finished, total cost=%llu ms",
+ (unsigned long long)(GetTickCount64() - boot_model_begin));
return 0;
}
--
Gitblit v1.9.3