!6209 fix socket fd leak

Merge pull request !6209 from shiyifan/master
This commit is contained in:
openharmony_ci 2024-05-23 08:05:03 +00:00 committed by Gitee
commit d100c3bf77
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 3 additions and 0 deletions

View File

@ -84,6 +84,7 @@ void P2pConnectState::OnP2pStateChangeEvent(P2pState state)
if (state == P2P_STATE_STARTED) {
CONN_LOGI(CONN_WIFI_DIRECT, "state is P2P_STATE_STARTED");
} else {
timer_.Unregister(operation_->timerId_);
if (operation_ != nullptr) {
result.errorCode_ = SOFTBUS_ERR;
operation_->promise_.set_value(result);

View File

@ -79,6 +79,7 @@ void P2pCreateGroupState::OnP2pStateChangeEvent(P2pState state)
if (state == P2P_STATE_STARTED) {
CONN_LOGI(CONN_WIFI_DIRECT, "state is P2P_STATE_STARTED");
} else {
timer_.Unregister(operation_->timerId_);
if (operation_ != nullptr) {
result.errorCode_ = SOFTBUS_ERR;
operation_->promise_.set_value(result);

View File

@ -78,6 +78,7 @@ void P2pDestroyGroupState::OnP2pStateChangeEvent(P2pState state)
if (state == P2P_STATE_STARTED) {
CONN_LOGI(CONN_WIFI_DIRECT, "state is P2P_STATE_STARTED");
} else {
timer_.Unregister(operation_->timerId_);
if (operation_ != nullptr) {
result.errorCode_ = SOFTBUS_ERR;
operation_->promise_.set_value(result);