Index: branches/BNC_2.11.0/src/bnccore.cpp
===================================================================
--- branches/BNC_2.11.0/src/bnccore.cpp	(revision 5908)
+++ branches/BNC_2.11.0/src/bnccore.cpp	(revision 7574)
@@ -35,5 +35,5 @@
  * Created:    29-Aug-2006
  *
- * Changes:    
+ * Changes:
  *
  * -----------------------------------------------------------------------*/
@@ -43,20 +43,20 @@
 #include <cmath>
 
-#include "bnccore.h" 
-#include "bncutils.h" 
-#include "bncrinex.h" 
-#include "bncsettings.h" 
-#include "bncversion.h" 
-#include "RTCM3/ephemeris.h" 
-#include "rinex/rnxobsfile.h" 
-#include "rinex/rnxnavfile.h" 
+#include "bnccore.h"
+#include "bncutils.h"
+#include "bncrinex.h"
+#include "bncsettings.h"
+#include "bncversion.h"
+#include "RTCM3/ephemeris.h"
+#include "rinex/rnxobsfile.h"
+#include "rinex/rnxnavfile.h"
 
 #ifdef USE_COMBINATION
-#include "combination/bnccomb.h" 
+#include "combination/bnccomb.h"
 #endif
 
 using namespace std;
 
-// Singleton 
+// Singleton
 ////////////////////////////////////////////////////////////////////////////
 t_bncCore& bncCoreInstance() {
@@ -191,5 +191,5 @@
     if ( !logFileName.isEmpty() ) {
       expandEnvVar(logFileName);
-      _logFile = new QFile(logFileName + "_" + 
+      _logFile = new QFile(logFileName + "_" +
                           currDate.toString("yyMMdd").toAscii().data());
       _fileDate = currDate;
@@ -218,5 +218,5 @@
 }
 
-// New GPS Ephemeris 
+// New GPS Ephemeris
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::slotNewGPSEph(gpsephemeris* gpseph) {
@@ -231,10 +231,10 @@
   gpsephemeris** ee = &_gpsEph[gpseph->satellite-1];
 
-  if ( *ee != 0 && 
+  if ( *ee != 0 &&
        gpseph->GPSweek == (*ee)->GPSweek && gpseph->TOC == (*ee)->TOC ) {
     checkEphemeris(*ee, gpseph);
   }
 
-  if ( *ee == 0                         || 
+  if ( *ee == 0                         ||
        gpseph->GPSweek > (*ee)->GPSweek ||
        (gpseph->GPSweek == (*ee)->GPSweek && gpseph->TOC > (*ee)->TOC) ) {
@@ -248,5 +248,5 @@
   }
 }
-    
+
 // New Glonass Ephemeris
 ////////////////////////////////////////////////////////////////////////////
@@ -257,10 +257,10 @@
   // Check wrong Ephemerides
   // -----------------------
-  if (glonasseph->x_pos == 0.0 && 
-      glonasseph->y_pos == 0.0 && 
+  if (glonasseph->x_pos == 0.0 &&
+      glonasseph->y_pos == 0.0 &&
       glonasseph->z_pos == 0.0) {
     delete glonasseph;
     return;
-  } 
+  }
 
   glonassephemeris copy_glonasseph = *glonasseph;
@@ -274,13 +274,13 @@
   if (*ee != 0) {
     wwOld  = (*ee)->GPSWeek;
-    towOld = (*ee)->GPSTOW; 
+    towOld = (*ee)->GPSTOW;
     updatetime(&wwOld, &towOld, (*ee)->tb*1000, 0);  // Moscow -> GPS
 
     wwNew  = glonasseph->GPSWeek;
-    towNew = glonasseph->GPSTOW; 
+    towNew = glonasseph->GPSTOW;
     updatetime(&wwNew, &towNew, glonasseph->tb*1000, 0); // Moscow -> GPS
   }
 
-  if ( *ee == 0      || 
+  if ( *ee == 0      ||
        wwNew > wwOld ||
        (wwNew == wwOld && towNew > towOld) ) {
@@ -312,10 +312,11 @@
   if (galIndex < 0 || galIndex > PRN_GALILEO_END - PRN_GALILEO_START) {
     emit( newMessage("Wrong Galileo Satellite Number", true) );
-    exit(1);
+    delete galileoeph;
+    return;
   }
 
   galileoephemeris** ee = &_galileoEph[galIndex];
 
-  if ( *ee == 0                       || 
+  if ( *ee == 0                       ||
        galileoeph->Week > (*ee)->Week ||
        (galileoeph->Week == (*ee)->Week && galileoeph->TOC > (*ee)->TOC) ) {
@@ -341,5 +342,5 @@
 
     if ( Qt::CheckState(settings.value("ephV3").toInt()) == Qt::Checked) {
-      _rinexVers = 3;    
+      _rinexVers = 3;
     }
     else {
@@ -363,8 +364,8 @@
     QDateTime datTim = currentDateAndTimeGPS();
 
-    QString ephFileNameGPS = _ephPath + "BRDC" + 
+    QString ephFileNameGPS = _ephPath + "BRDC" +
                QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0'));
 
-    QString hlpStr = bncRinex::nextEpochStr(datTim, 
+    QString hlpStr = bncRinex::nextEpochStr(datTim,
                          settings.value("ephIntr").toString());
 
@@ -444,17 +445,17 @@
         QString line;
         line.sprintf(
-          "%9.2f%11sN: GNSS NAV DATA    M: Mixed%12sRINEX VERSION / TYPE\n", 
+          "%9.2f%11sN: GNSS NAV DATA    M: Mixed%12sRINEX VERSION / TYPE\n",
           3.0, "", "");
         *_ephStreamGPS << line;
-        
+
         QString hlp = currentDateAndTimeGPS().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
-        *_ephStreamGPS << _pgmName.toAscii().data() 
-                       << _userName.toAscii().data() 
-                       << hlp.toAscii().data() 
+        *_ephStreamGPS << _pgmName.toAscii().data()
+                       << _userName.toAscii().data()
+                       << hlp.toAscii().data()
                        << "PGM / RUN BY / DATE" << endl;
 
         line.sprintf("%60sEND OF HEADER\n", "");
         *_ephStreamGPS << line;
-        
+
         _ephStreamGPS->flush();
       }
@@ -469,9 +470,9 @@
                      t_rnxNavFile::defaultRnxNavVersion2, "", "");
         *_ephStreamGPS << line;
-         
+
         QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
-        *_ephStreamGPS << _pgmName.toAscii().data() 
-                       << _userName.toAscii().data() 
-                       << hlp.toAscii().data() 
+        *_ephStreamGPS << _pgmName.toAscii().data()
+                       << _userName.toAscii().data()
+                       << hlp.toAscii().data()
                        << "PGM / RUN BY / DATE" << endl;
 
@@ -486,9 +487,9 @@
                      t_rnxNavFile::defaultRnxNavVersion2, "", "");
         *_ephStreamGlonass << line;
-        
+
         QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
-        *_ephStreamGlonass << _pgmName.toAscii().data() 
-                           << _userName.toAscii().data() 
-                           << hlp.toAscii().data() 
+        *_ephStreamGlonass << _pgmName.toAscii().data()
+                           << _userName.toAscii().data()
+                           << hlp.toAscii().data()
                            << "PGM / RUN BY / DATE" << endl;
 
@@ -627,5 +628,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::slotQuit() {
@@ -635,5 +636,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::slotNewCorrLine(QString line, QString staID, bncTime coTime) {
@@ -715,5 +716,5 @@
 }
 
-// Dump List of Corrections 
+// Dump List of Corrections
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::dumpCorrs(const QList<QString>& allCorrs) {
@@ -723,5 +724,5 @@
     while (it.hasNext()) {
       QString corrLine = it.next() + "\n";
-    
+
       QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
       while (is.hasNext()) {
@@ -742,9 +743,9 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::setConfFileName(const QString& confFileName) {
   if (confFileName.isEmpty()) {
-    _confFileName = QDir::homePath() + QDir::separator() 
+    _confFileName = QDir::homePath() + QDir::separator()
                   + ".config" + QDir::separator()
                   + qApp->organizationName() + QDir::separator()
@@ -802,5 +803,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::initCombination() {
@@ -814,5 +815,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::stopCombination() {
