Changeset 3207 in ntrip for trunk/BNC


Ignore:
Timestamp:
Mar 30, 2011, 7:02:18 PM (14 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/upload
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/upload/bncrtnetdecoder.cpp

    r3206 r3207  
    7272bncRtnetDecoder::~bncRtnetDecoder() {
    7373  for (int ic = 0; ic < _casters.size(); ic++) {
    74     delete _casters[ic];
     74    _casters[ic]->deleteSafely();
    7575  }
    7676}
  • trunk/BNC/upload/bncuploadcaster.cpp

    r3206 r3207  
    4848  _outSocket  = 0;
    4949  _sOpenTrial = 0;
     50
     51  _isToBeDeleted = false;
    5052
    5153  // Raw Output
     
    186188}
    187189
     190// Safe Desctructor
     191////////////////////////////////////////////////////////////////////////////
     192void bncUploadCaster::deleteSafely() {
     193  QMutexLocker locker(&_mutex);
     194  _isToBeDeleted = true;
     195}
     196
    188197// Destructor
    189198////////////////////////////////////////////////////////////////////////////
     
    337346
    338347  QMutexLocker locker(&_mutex);
     348
     349  // Safely stop and delete
     350  // ----------------------
     351  if (_isToBeDeleted) {
     352    QThread::quit();
     353    deleteLater();
     354    return;
     355  }
    339356
    340357  // Prepare list of lines with satellite positions in SP3-like format
  • trunk/BNC/upload/bncuploadcaster.h

    r3206 r3207  
    2020                  const QString& rnxFileName,
    2121                  const QString& outFileName);
     22 protected:
    2223  virtual ~bncUploadCaster();
     24 public:
     25  void deleteSafely();
    2326  virtual void run();
    2427  void decodeRtnetStream(char* buffer, int bufLen,
     
    4043
    4144  QMap<QString, t_eph*>* _ephMap;
     45  bool                   _isToBeDeleted;
    4246  QMutex                 _mutex; 
    4347  QString                _rtnetStreamBuffer;
Note: See TracChangeset for help on using the changeset viewer.