_W("Socket was disconnected. fd(%d)", fd);
- if (proxy->main_port_->GetFd() == fd) {
+ if (proxy->main_port_.get() != nullptr && proxy->main_port_->GetFd() == fd) {
proxy->listener_ = nullptr;
proxy->main_port_->SetDisconnectedSource(0);
if (listener)
if (listener)
listener->OnDisconnected(proxy->target_appid_);
- DebugPort::GetInst().RemoveSession(proxy->main_port_->GetFd());
- proxy->main_port_.reset();
+ if (proxy->main_port_.get() != nullptr) {
+ DebugPort::GetInst().RemoveSession(proxy->main_port_->GetFd());
+ proxy->main_port_.reset();
+ }
proxy->delegate_port_.reset();
return FALSE;
}
}
void Proxy::DisconnectPort() {
+ DebugPort::GetInst().RemoveSession(main_port_->GetFd());
main_port_.reset();
}