Changeset 7888 in ntrip


Ignore:
Timestamp:
Apr 26, 2016, 3:28:16 PM (8 years ago)
Author:
stuerze
Message:

a try to fix a persistent memory leak

Location:
trunk/BNC/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/pppClient.cpp

    r7866 r7888  
    282282      unsigned nObs        = 0;
    283283      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
    284         t_pppSatObs* satObs = obsVector.at(ii);
     284        const t_pppSatObs* satObs = obsVector.at(ii);
    285285        if (satObs->prn().system() == 'R') {
    286286          if (tLC == t_lc::dummy) {
  • trunk/BNC/src/bncgetthread.cpp

    r7859 r7888  
    641641#endif
    642642    }
    643 
    644     delete _query;
     643    if (_query) {
     644      delete _query;
     645    }
    645646    if      (_ntripVersion == "U") {
    646647      _query = new bncNetQueryUdp();
  • trunk/BNC/src/ephemeris.cpp

    r7639 r7888  
    3636////////////////////////////////////////////////////////////////////////////
    3737void t_eph::setOrbCorr(const t_orbCorr* orbCorr) {
    38   delete _orbCorr;
     38  if (_orbCorr) {
     39    delete _orbCorr;
     40    _orbCorr = 0;
     41  }
    3942  _orbCorr = new t_orbCorr(*orbCorr);
    4043}
     
    4346////////////////////////////////////////////////////////////////////////////
    4447void t_eph::setClkCorr(const t_clkCorr* clkCorr) {
    45   delete _clkCorr;
     48  if (_clkCorr) {
     49    delete _clkCorr;
     50    _clkCorr = 0;
     51  }
    4652  _clkCorr = new t_clkCorr(*clkCorr);
    4753}
Note: See TracChangeset for help on using the changeset viewer.