Merge 577ae9b36d34cdc585e8d0bce3bd98eca9e8c13c on remote branch
Change-Id: I056961bc120b0a5b21de26b749e42d2e7b44f3ac
diff --git a/core/SystemStatus.h b/core/SystemStatus.h
index 9182f49..d7e60dd 100644
--- a/core/SystemStatus.h
+++ b/core/SystemStatus.h
@@ -504,12 +504,11 @@
mType = (int32_t)itemBase.getType();
}
inline bool equals(const SystemStatusNetworkInfo& peer) {
- for (uint8_t i = 0; i < MAX_NETWORK_HANDLES; ++i) {
- if (!(mAllNetworkHandles[i] == peer.mAllNetworkHandles[i])) {
- return false;
- }
- }
- return true;
+ bool rtv = (peer.mConnected == mConnected);
+ for (uint8_t i = 0; rtv && i < MAX_NETWORK_HANDLES; ++i) {
+ rtv &= (mAllNetworkHandles[i] == peer.mAllNetworkHandles[i]);
+ }
+ return rtv;
}
inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) {
uint64_t allTypes = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mAllTypes;
diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp
index 5c4be47..06c1e46 100644
--- a/location/LocationAPI.cpp
+++ b/location/LocationAPI.cpp
@@ -132,9 +132,11 @@
}
pthread_mutex_unlock(&gDataMutex);
- if ((true == invokeCallback) && (nullptr != destroyCompleteCb)) {
+ if (invokeCallback) {
LOC_LOGd("invoke client destroy cb");
- (destroyCompleteCb) ();
+ if (!destroyCompleteCb) {
+ (destroyCompleteCb) ();
+ }
delete this;
}
@@ -286,7 +288,7 @@
gData.clientData.erase(it);
- if ((NULL != destroyCompleteCb) && (false == needToWait)) {
+ if (!needToWait) {
invokeDestroyCb = true;
}
} else {
@@ -295,8 +297,10 @@
}
pthread_mutex_unlock(&gDataMutex);
- if (invokeDestroyCb == true) {
- (destroyCompleteCb) ();
+ if (invokeDestroyCb) {
+ if (!destroyCompleteCb) {
+ (destroyCompleteCb) ();
+ }
delete this;
}
}