From 43cd50ae5629f8e18c349fe5e9a58aac298df9f2 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期五, 06 二月 2026 16:58:32 +0800
Subject: [PATCH] 1.修复一个判断逻辑问题;
---
SourceCode/Bond/Servo/CEquipment.cpp | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 0668179..88f93ac 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -2135,18 +2135,6 @@
return FALSE;
}
- // 濡傛灉娌℃湁鍙敤浣嶇疆锛屾姤閿�
- Lock();
- CSlot* pSlot = getSlot(putSlot - 1);
- ASSERT(pSlot);
- if (pSlot->getContext() != nullptr) {
- Unlock();
- LOGE("<CEquipemnt-%s>onPreStoredJob,鎸囧畾slot(port:%d)鏈夋枡锛岃娉ㄦ剰椋庨櫓锛�", m_strName.c_str(), port);
- return FALSE;
- }
- Unlock();
-
-
if (m_listener.onPreStoredJob != nullptr) {
if (!m_listener.onPreStoredJob(this, port, pJobDataB, putSlot)) {
return FALSE;
@@ -2157,6 +2145,21 @@
}
}
+ // 濡傛灉娌℃湁鍙敤浣嶇疆锛屾姤閿欙紙闇�鍦� listener 鍥炶皟鍚庢嬁鍒� putSlot锛�
+ if (putSlot <= 0) {
+ LOGE("<CEquipemnt-%s>onPreStoredJob, putSlot鏃犳晥(port:%d).", m_strName.c_str(), port);
+ return FALSE;
+ }
+ Lock();
+ CSlot* pSlot = getSlot(putSlot - 1);
+ ASSERT(pSlot);
+ if (pSlot->getContext() != nullptr) {
+ Unlock();
+ LOGE("<CEquipemnt-%s>onPreStoredJob,鎸囧畾slot(port:%d)鏈夋枡锛岃娉ㄦ剰椋庨櫓锛�", m_strName.c_str(), port);
+ return FALSE;
+ }
+ Unlock();
+
return TRUE;
}
--
Gitblit v1.9.3