summaryrefslogtreecommitdiff
path: root/location/LocationAPI.cpp
diff options
context:
space:
mode:
authorNaresh Munagala <nareshm@codeaurora.org>2017-04-07 10:45:53 +0530
committerNaresh Munagala <nareshm@codeaurora.org>2017-04-07 10:52:41 +0530
commit2b7f0b434d7eb61a38510a98ffc6af409d672d0b (patch)
treeacbc1ede660b5f18cbc1c19f13262ab55d825a78 /location/LocationAPI.cpp
parentd48c19e8f0719d6b7b81a91b8e0d1a335fa0e2fb (diff)
downloadgps-2b7f0b434d7eb61a38510a98ffc6af409d672d0b.tar.gz
fix crash issue while deleting adapters
crash was observed while deleting gnss, flp and geofence adapters. solution is not to delete the Adapter in the deinitialize function Change-Id: Ia260dd6f2c532111b82b621a3640d6ef834bb671 CRs-Fixed: 2030458
Diffstat (limited to 'location/LocationAPI.cpp')
-rw-r--r--location/LocationAPI.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp
index c800851..3086adc 100644
--- a/location/LocationAPI.cpp
+++ b/location/LocationAPI.cpp
@@ -201,37 +201,14 @@ LocationAPI::~LocationAPI()
auto it = gData.clientData.find(this);
if (it != gData.clientData.end()) {
- size_t gnssClientCount = 0;
- size_t flpClientCount = 0;
- size_t geofenceClientCount = 0;
- for (auto it2=gData.clientData.begin(); it2 != gData.clientData.end(); ++it2) {
- if (isGnssClient(it2->second)) {
- gnssClientCount++;
- }
- if (isFlpClient(it2->second)) {
- flpClientCount++;
- }
- if (isGeofenceClient(it2->second)) {
- geofenceClientCount++;
- }
- }
if (isGnssClient(it->second) && NULL != gData.gnssInterface) {
gData.gnssInterface->removeClient(it->first);
- if (1 == gnssClientCount && NULL == gData.controlAPI) {
- gData.gnssInterface->deinitialize();
- }
}
if (isFlpClient(it->second) && NULL != gData.flpInterface) {
gData.flpInterface->removeClient(it->first);
- if (1 == flpClientCount) {
- gData.flpInterface->deinitialize();
- }
}
if (isGeofenceClient(it->second) && NULL != gData.geofenceInterface) {
gData.geofenceInterface->removeClient(it->first);
- if (1 == geofenceClientCount) {
- gData.geofenceInterface->deinitialize();
- }
}
gData.clientData.erase(it);
} else {
@@ -593,16 +570,6 @@ LocationControlAPI::~LocationControlAPI()
LOC_LOGD("LOCATION CONTROL API DESTRUCTOR");
pthread_mutex_lock(&gDataMutex);
- size_t gnssClientCount = 0;
- for (auto it=gData.clientData.begin(); it != gData.clientData.end(); ++it) {
- if (isGnssClient(it->second)) {
- gnssClientCount++;
- }
- }
- if (gData.gnssInterface != NULL && 0 == gnssClientCount) {
- //@todo: we might want to call gData.gnssInterface.disable before deinitialize?
- gData.gnssInterface->deinitialize();
- }
gData.controlAPI = NULL;
pthread_mutex_unlock(&gDataMutex);