- Timestamp:
- Dec 14, 2007, 12:50:34 PM (17 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnccaster.cpp
r464 r603 108 108 delete _server; 109 109 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 } 111 117 } 112 118 -
trunk/BNC/bncmain.cpp
r592 r603 40 40 41 41 #include <unistd.h> 42 #include <signal.h> 42 43 #include <QApplication> 43 44 #include <QFile> … … 48 49 49 50 using namespace std; 51 52 bncCaster* _caster = 0; 53 54 void catch_signal(int) { 55 delete _caster; 56 cout << "Program Interrupted by Ctrl-C" << endl; 57 exit(0); 58 } 50 59 51 60 // Main Program … … 100 109 // ---------------------------- 101 110 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); 104 114 115 _caster = new bncCaster(settings.value("outFile").toString(), 116 settings.value("outPort").toInt()); 117 105 118 app.setPort(settings.value("outEphPort").toInt()); 106 119 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&)), 109 122 &app, SLOT(slotMessage(const QByteArray&))); 110 123 … … 126 139 &app, SLOT(slotMessage(const QByteArray&))); 127 140 128 caster->addGetThread(getThread);141 _caster->addGetThread(getThread); 129 142 130 143 getThread->start(); 131 144 } 132 if ( caster->numStations() == 0) {145 if (_caster->numStations() == 0) { 133 146 return 0; 134 147 }
Note:
See TracChangeset
for help on using the changeset viewer.