Changeset 3208 in ntrip for trunk/BNC/upload


Ignore:
Timestamp:
Mar 30, 2011, 7:20:18 PM (14 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

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

    r3207 r3208  
    193193  QMutexLocker locker(&_mutex);
    194194  _isToBeDeleted = true;
     195  if (!isRunning()) {
     196    delete this;
     197  }
    195198}
    196199
     
    198201////////////////////////////////////////////////////////////////////////////
    199202bncUploadCaster::~bncUploadCaster() {
     203  if (isRunning()) {
     204    wait();
     205  }
    200206  if (_ephMap) {
    201207    QMapIterator<QString, t_eph*> it(*_ephMap);
     
    216222void bncUploadCaster::run() {
    217223  while (true) {
     224    {
     225      QMutexLocker locker(&_mutex);
     226      if (_isToBeDeleted) {
     227        QThread::quit();
     228        deleteLater();
     229        return;
     230      }
     231    }
    218232    uploadClockOrbitBias();
    219233    msleep(10);
     
    346360
    347361  QMutexLocker locker(&_mutex);
    348 
    349   // Safely stop and delete
    350   // ----------------------
    351   if (_isToBeDeleted) {
    352     QThread::quit();
    353     deleteLater();
    354     return;
    355   }
    356362
    357363  // Prepare list of lines with satellite positions in SP3-like format
Note: See TracChangeset for help on using the changeset viewer.