This commit is contained in:
aozhiwei 2019-12-12 10:32:43 +08:00
parent fa634112fb
commit e2b9fd1517

View File

@ -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) void MasterSvrMgr::RemoveRequest(int socket_handle, long long context_id, bool auto_free)
{ {
if (context_id == GetContextIdBySocket(socket_handle)) { if (context_id == GetContextIdBySocket(socket_handle)) {
if (auto_free) {
f8::MsgHdr* hdr = GetHdrByContextId(context_id); f8::MsgHdr* hdr = GetHdrByContextId(context_id);
if (hdr) { if (hdr) {
a8::TimerAttacher* timer_attacher = (a8::TimerAttacher*)hdr->user_data; a8::TimerAttacher* timer_attacher = (a8::TimerAttacher*)hdr->user_data;
delete timer_attacher; delete timer_attacher;
hdr->user_data = nullptr;
if (auto_free) {
if (hdr->buf) { if (hdr->buf) {
free((char*)hdr->buf); free((char*)hdr->buf);
} }