优化代码

This commit is contained in:
ziyue 2021-09-16 10:05:04 +08:00
parent 3d64f7253c
commit dfa9001ed1

View File

@ -76,6 +76,9 @@ void WebRtcSession::onError(const SockException &err) {
//本WebRtcSession对象将在超时后自动销毁
WarnP(this) << err.what();
if (!_transport) {
return;
}
auto transport = std::move(_transport);
this->Session::getPoller()->async([transport] {
//延时减引用防止使用transport对象时销毁对象