Changeset 603 in ntrip


Ignore:
Timestamp:
Dec 14, 2007, 12:50:34 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnccaster.cpp

    r464 r603  
    108108  delete _server;
    109109  delete _sockets;
    110   delete _epochs;
     110  if (_epochs) {
     111    QListIterator<Observation*> it(_epochs->values());
     112    while (it.hasNext()) {
     113      delete it.next();
     114    }
     115    delete _epochs;
     116  }
    111117}
    112118
  • trunk/BNC/bncmain.cpp

    r592 r603  
    4040
    4141#include <unistd.h>
     42#include <signal.h>
    4243#include <QApplication>
    4344#include <QFile>
     
    4849
    4950using namespace std;
     51
     52bncCaster* _caster = 0;
     53
     54void catch_signal(int) {
     55  delete _caster;
     56  cout << "Program Interrupted by Ctrl-C" << endl;
     57  exit(0);
     58}
    5059
    5160// Main Program
     
    100109  // ----------------------------
    101110  else {
    102     bncCaster* caster = new bncCaster(settings.value("outFile").toString(),
    103                                       settings.value("outPort").toInt());
     111    // Ctrl-C Signal Handling
     112    // ----------------------
     113    signal(SIGINT, catch_signal);
    104114
     115    _caster = new bncCaster(settings.value("outFile").toString(),
     116                            settings.value("outPort").toInt());
     117   
    105118    app.setPort(settings.value("outEphPort").toInt());
    106119
    107     app.connect(caster, SIGNAL(getThreadErrors()), &app, SLOT(quit()));
    108     app.connect(caster, SIGNAL(newMessage(const QByteArray&)),
     120    app.connect(_caster, SIGNAL(getThreadErrors()), &app, SLOT(quit()));
     121    app.connect(_caster, SIGNAL(newMessage(const QByteArray&)),
    109122                &app, SLOT(slotMessage(const QByteArray&)));
    110123 
     
    126139                  &app, SLOT(slotMessage(const QByteArray&)));
    127140
    128       caster->addGetThread(getThread);
     141      _caster->addGetThread(getThread);
    129142
    130143      getThread->start();
    131144    }
    132     if (caster->numStations() == 0) {
     145    if (_caster->numStations() == 0) {
    133146      return 0;
    134147    }
Note: See TracChangeset for help on using the changeset viewer.