From e2b9fd1517580511bd7e80bfccd8296f4a88fc54 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 12 Dec 2019 10:32:43 +0800 Subject: [PATCH] 1 --- server/wsproxy/mastersvrmgr.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/wsproxy/mastersvrmgr.cc b/server/wsproxy/mastersvrmgr.cc index 7b84546..d4f56fd 100644 --- a/server/wsproxy/mastersvrmgr.cc +++ b/server/wsproxy/mastersvrmgr.cc @@ -154,11 +154,12 @@ void MasterSvrMgr::RequestTargetServer(f8::MsgHdr& hdr, const std::string& team_ void MasterSvrMgr::RemoveRequest(int socket_handle, long long context_id, bool auto_free) { if (context_id == GetContextIdBySocket(socket_handle)) { - if (auto_free) { - f8::MsgHdr* hdr = GetHdrByContextId(context_id); - if (hdr) { - a8::TimerAttacher* timer_attacher = (a8::TimerAttacher*)hdr->user_data; - delete timer_attacher; + f8::MsgHdr* hdr = GetHdrByContextId(context_id); + if (hdr) { + a8::TimerAttacher* timer_attacher = (a8::TimerAttacher*)hdr->user_data; + delete timer_attacher; + hdr->user_data = nullptr; + if (auto_free) { if (hdr->buf) { free((char*)hdr->buf); }