diff options
author | qctecmdr Service <qctecmdr@qualcomm.com> | 2019-01-15 10:36:14 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-01-15 10:36:14 -0800 |
commit | 7d9edb3c227a53d146afd00967b9619da33e5fad (patch) | |
tree | 4c1daade88f0294cdd5d2768962062ec39a1b8cc /gnss | |
parent | 63dca9043692387636fd8b8023129d1ef37b9df9 (diff) | |
parent | abfeea182d6ea4905f80da6f17556da278cce4d4 (diff) | |
download | gps-7d9edb3c227a53d146afd00967b9619da33e5fad.tar.gz |
Merge "Fix KW P1 related issues"
Diffstat (limited to 'gnss')
-rw-r--r-- | gnss/GnssAdapter.cpp | 14 | ||||
-rw-r--r-- | gnss/XtraSystemStatusObserver.cpp | 7 |
2 files changed, 13 insertions, 8 deletions
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 8112a71..791f9d6 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2000,8 +2000,10 @@ GnssAdapter::restartSessions() } // get the LocationOptions that has the smallest interval, which should be the active one - TrackingOptions smallestIntervalOptions = {}; // size is zero until set for the first time - TrackingOptions highestPowerTrackingOptions = {}; + TrackingOptions smallestIntervalOptions; // size is zero until set for the first time + TrackingOptions highestPowerTrackingOptions; + memset(&smallestIntervalOptions, 0, sizeof(smallestIntervalOptions)); + memset(&highestPowerTrackingOptions, 0, sizeof(highestPowerTrackingOptions)); for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end(); ++it) { // size of zero means we havent set it yet if (0 == smallestIntervalOptions.size || @@ -3023,8 +3025,8 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, loc_nmea_generate_pos(ulpLocation, locationExtended, mLocSystemInfo, generate_nmea, nmeaArraystr); stringstream ss; - for (auto sentence : nmeaArraystr) { - ss << sentence; + for (auto itor = nmeaArraystr.begin(); itor != nmeaArraystr.end(); ++itor) { + ss << *itor; } string s = ss.str(); reportNmea(s.c_str(), s.length()); @@ -3119,8 +3121,8 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) std::vector<std::string> nmeaArraystr; loc_nmea_generate_sv(svNotify, nmeaArraystr); stringstream ss; - for (auto sentence : nmeaArraystr) { - ss << sentence; + for (auto itor = nmeaArraystr.begin(); itor != nmeaArraystr.end(); ++itor) { + ss << *itor; } string s = ss.str(); reportNmea(s.c_str(), s.length()); diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index 6df5480..d84ae42 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -219,8 +219,11 @@ void XtraSystemStatusObserver::notify(const list<IDataItemCore*>& dlist) } inline ~HandleOsObserverUpdateMsg() { - for (auto each : mDataItemList) { - delete each; + for (auto itor = mDataItemList.begin(); itor != mDataItemList.end(); ++itor) { + if (*itor != nullptr) { + delete *itor; + *itor = nullptr; + } } } |