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); }