소스 검색

fix servantproxy may crash when ctrl+c

ruanshudong 1 년 전
부모
커밋
cc4e4afa4a
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      servant/libservant/ServantProxy.cpp

+ 5 - 0
servant/libservant/ServantProxy.cpp

@@ -1560,6 +1560,11 @@ void ServantProxy::selectNetThreadInfo(ServantProxyThreadData *pSptd, ObjectProx
 				}
 			}
 
+			if(communicatorEpollInfo->_communicator->isTerminating())
+			{
+				throw TarsCommunicatorException("communicator may deconstruct");
+			}
+
 			assert(communicatorEpollInfo->_netSeq < _communicator->getCommunicatorEpollNum());
 
 			//循环使用下一个网络线程发送数据