From 5048ebb8bf71fd8b86cb2667c026680fe6996f53 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:24:20 +0800 Subject: [PATCH] [saco] Implement/match CLabelPool destructor --- saco/net/labelpool.cpp | 11 +++++++++++ saco/net/labelpool.h | 1 + 2 files changed, 12 insertions(+) diff --git a/saco/net/labelpool.cpp b/saco/net/labelpool.cpp index cd2c87b..c59a238 100644 --- a/saco/net/labelpool.cpp +++ b/saco/net/labelpool.cpp @@ -10,6 +10,17 @@ CLabelPool::CLabelPool() } } +CLabelPool::~CLabelPool() +{ + for(WORD wLabelID = 0; wLabelID < MAX_LABELS; wLabelID++) + { + if(m_bLabelSlotState[wLabelID]) + { + Delete(wLabelID); + } + } +} + BOOL CLabelPool::Delete(WORD wLabelID) { if(wLabelID >= MAX_LABELS) return FALSE; diff --git a/saco/net/labelpool.h b/saco/net/labelpool.h index 933c9bf..51e1010 100644 --- a/saco/net/labelpool.h +++ b/saco/net/labelpool.h @@ -14,6 +14,7 @@ private: BOOL m_bLabelSlotState[MAX_LABELS]; public: CLabelPool(); + ~CLabelPool(); BOOL Delete(WORD wLabelID);