bugfix for crash test

Signed-off-by: yanxiaotao@huawei.com <yanxiaotao@huawei.com>
This commit is contained in:
yanxiaotao@huawei.com 2023-12-03 14:22:26 +08:00
parent ccdbedbd11
commit 69494bfcbb
2 changed files with 4 additions and 3 deletions

View File

@ -171,7 +171,7 @@ void WifiDeviceStub::RemoveDeviceCbDeathRecipient(void)
void WifiDeviceStub::RemoveDeviceCbDeathRecipient(const wptr<IRemoteObject> &remoteObject)
{
WIFI_LOGI("RemoveDeathRecipient, remoteObject: %{public}p!", &remoteObject);
WIFI_LOGI("RemoveDeathRecipient, remoteObject.promote: 0x%{public}x!", remoteObject.promote());
WIFI_LOGI("RemoveDeathRecipient, remoteObject.promote: %{public}p!", static_cast<void*>(remoteObject.promote()));
std::lock_guard<std::mutex> lock(mutex_);
RemoteDeathMap::iterator iter = remoteDeathMap.find(remoteObject.promote());
if (iter == remoteDeathMap.end()) {
@ -789,7 +789,8 @@ void WifiDeviceStub::OnRegisterCallBack(uint32_t code, MessageParcel &data, Mess
#else
deathRecipient_ = new (std::nothrow) WifiDeathRecipient(*this);
remoteDeathMap.insert(std::make_pair(remote, deathRecipient_));
WIFI_LOGI("OnRegisterCallBack, add deathRecipient: 0x%{public}x", remote);
WIFI_LOGI("OnRegisterCallBack, add deathRecipient, remote: %{public}p",
static_cast<void*>(remote));
#endif
}
if ((remote->IsProxyObject()) && (!remote->AddDeathRecipient(deathRecipient_))) {

View File

@ -21,7 +21,7 @@ namespace OHOS {
namespace Wifi {
void WifiScanDeathRecipient::OnRemoteDied(const wptr<IRemoteObject>& remoteObject)
{
WIFI_LOGD("WifiScanDeathRecipient::OnRemoteDied!");
WIFI_LOGI("WifiScanDeathRecipient::OnRemoteDied! remoteObject: %{public}p", &remoteObject);
WifiInternalEventDispatcher::GetInstance().RemoveScanCallback(remoteObject.promote());
}
} // namespace Wifi