From 1ff714838c03cba1a18884d5b48a20ee6c4275ac Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期五, 21 五月 2021 15:00:53 +0800
Subject: [PATCH] class MsgI, ShmMsgQueue, no bind to shm.

---
 src/shm_msg_queue.cpp |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/src/shm_msg_queue.cpp b/src/shm_msg_queue.cpp
index 1d78e8c..be2d2a2 100644
--- a/src/shm_msg_queue.cpp
+++ b/src/shm_msg_queue.cpp
@@ -31,12 +31,6 @@
 
 } // namespace
 
-ShmMsgQueue::MQId ShmMsgQueue::NewId()
-{
-	static auto &id = GetData("Must init shared memory before use! Please make sure center is running.");
-	return (++id) * 10;
-}
-
 ShmMsgQueue::ShmMsgQueue(ShmType &segment, const MQId id, const int len) :
     id_(id),
     queue_(segment, MsgQIdToName(id_), len, segment.get_segment_manager())
@@ -84,7 +78,7 @@
 			if (IsCmd(val)) {
 				LOG_DEBUG() << "clsing queue " << id << ", has a cmd" << DecodeCmd(val);
 			} else {
-				MsgI(val).Release();
+				MsgI(val, shm).Release();
 			}
 		}
 	}

--
Gitblit v1.8.0