소스 검색

fix problem at shutdown

David Rose 17 년 전
부모
커밋
09fe2062c2
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 0
      panda/src/pstatclient/pStatClient.cxx
  2. 1 1
      panda/src/pstatclient/pStatClientImpl.cxx

+ 5 - 0
panda/src/pstatclient/pStatClient.cxx

@@ -372,6 +372,11 @@ void PStatClient::
 client_main_tick() {
   LightReMutexHolder holder(_lock);
   if (has_impl()) {
+    if (!_impl->client_is_connected()) {
+      client_disconnect();
+      return;
+    }
+
     _impl->client_main_tick();
 
     MultiThingsByName::const_iterator ni =

+ 1 - 1
panda/src/pstatclient/pStatClientImpl.cxx

@@ -458,7 +458,7 @@ handle_server_control_message(const PStatServerControlMessage &message) {
 void PStatClientImpl::
 connection_reset(const PT(Connection) &connection, bool) {
   if (connection == _tcp_connection) {
-    _client->client_disconnect();
+    client_disconnect();
   } else if (connection == _udp_connection) {
     pstats_cat.warning()
       << "Trouble sending UDP; switching to TCP only.\n";