sdm660-common: gps: Add NULL check before object access
Correct the NULL check code block and add NULL check before object access. Change-Id: Ic41b781b41fb4e21bbff8801d500a41a6d7219d0 CRs-fixed: 3084543
This commit is contained in:
parent
eaab2ad176
commit
d88a67c4c7
1 changed files with 6 additions and 2 deletions
|
@ -194,8 +194,10 @@ BatteryListenerImpl::~BatteryListenerImpl()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mDone = true;
|
mDone = true;
|
||||||
|
if (NULL != mThread) {
|
||||||
mThread->join();
|
mThread->join();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BatteryListenerImpl::serviceDied(uint64_t cookie __unused,
|
void BatteryListenerImpl::serviceDied(uint64_t cookie __unused,
|
||||||
const wp<hidl::base::V1_0::IBase>& who)
|
const wp<hidl::base::V1_0::IBase>& who)
|
||||||
|
@ -211,7 +213,9 @@ void BatteryListenerImpl::serviceDied(uint64_t cookie __unused,
|
||||||
}
|
}
|
||||||
mHealth = NULL;
|
mHealth = NULL;
|
||||||
mCond.notify_one();
|
mCond.notify_one();
|
||||||
|
if (NULL != mThread) {
|
||||||
mThread->join();
|
mThread->join();
|
||||||
|
}
|
||||||
std::lock_guard<std::mutex> _l(mLock);
|
std::lock_guard<std::mutex> _l(mLock);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue