From 68c7bef33e74f23aa0136ccd6f7faa654d671ebc Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期五, 21 五月 2021 09:23:01 +0800
Subject: [PATCH] center publish notify; fix topic partial match.

---
 src/msg.cpp |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/msg.cpp b/src/msg.cpp
index edffff1..dca2044 100644
--- a/src/msg.cpp
+++ b/src/msg.cpp
@@ -18,7 +18,7 @@
 #include "msg.h"
 #include "bh_util.h"
 #include "defs.h"
-#include "socket.h"
+#include "shm_socket.h"
 
 namespace bhome_msg
 {
@@ -37,8 +37,12 @@
 	}
 	auto n = meta()->count_.Dec();
 	if (n == 0) {
-		int64_t free_cmd = (id() << 4) | EncodeCmd(eCmdFree);
-		Sender().Send(BHTopicCenterAddress(), free_cmd);
+		if (meta()->managed_) {
+			int64_t free_cmd = (id() << 4) | EncodeCmd(eCmdFree);
+			Sender().Send(BHTopicCenterAddress(), free_cmd);
+		} else {
+			Free();
+		}
 	} else if (n < 0) {
 		LOG_FATAL() << "error double release data.";
 		throw std::runtime_error("double release msg.");

--
Gitblit v1.8.0