Index: trunk/BNC/RTCM3/RTCM3Decoder.cpp
===================================================================
--- trunk/BNC/RTCM3/RTCM3Decoder.cpp	(revision 2710)
+++ trunk/BNC/RTCM3/RTCM3Decoder.cpp	(revision 2711)
@@ -237,12 +237,12 @@
             for (int iSat = 0; iSat < gnssData.numsats; iSat++) {
 
-              t_obs* obs   = new t_obs();
-              int    satID = gnssData.satellites[iSat];
+              t_obs obs;
+              int   satID = gnssData.satellites[iSat];
 
               // GPS
               // ---
               if      (satID >= PRN_GPS_START     && satID <= PRN_GPS_END) {
-                obs->satSys = 'G';
-                obs->satNum = satID;
+                obs.satSys = 'G';
+                obs.satNum = satID;
               }
 
@@ -250,13 +250,12 @@
               // -------
               else if (satID >= PRN_GLONASS_START && satID <= PRN_GLONASS_END) {
-                obs->satSys = 'R';
-                obs->satNum = satID - PRN_GLONASS_START + 1;
-                if (obs->satNum <= PRN_GLONASS_NUM && 
-                    parser.GLOFreq[obs->satNum-1] != 0) {
-                  obs->slotNum   = parser.GLOFreq[obs->satNum-1] - 100;
+                obs.satSys = 'R';
+                obs.satNum = satID - PRN_GLONASS_START + 1;
+                if (obs.satNum <= PRN_GLONASS_NUM && 
+                    parser.GLOFreq[obs.satNum-1] != 0) {
+                  obs.slotNum   = parser.GLOFreq[obs.satNum-1] - 100;
                 }
                 else { 
-                  delete obs;
-                  obs = 0;
+                  continue;
                 }
               }
@@ -265,6 +264,6 @@
               // -------
               else if (satID >= PRN_GALILEO_START && satID <= PRN_GALILEO_END) {
-                obs->satSys = 'E';
-                obs->satNum = satID - PRN_GALILEO_START + 1;
+                obs.satSys = 'E';
+                obs.satNum = satID - PRN_GALILEO_START + 1;
               }
 
@@ -272,6 +271,6 @@
               // ----
               else if (satID >= PRN_WAAS_START && satID <= PRN_WAAS_END) {
-                obs->satSys = 'S';
-                obs->satNum = satID - PRN_WAAS_START + 20;
+                obs.satSys = 'S';
+                obs.satNum = satID - PRN_WAAS_START + 20;
               }
 
@@ -279,6 +278,6 @@
               // -------------
               else if (satID >= PRN_GIOVE_START && satID <= PRN_GIOVE_END) {
-                obs->satSys = 'E';
-                obs->satNum = satID - PRN_GIOVE_START + PRN_GIOVE_OFFSET;
+                obs.satSys = 'E';
+                obs.satNum = satID - PRN_GIOVE_START + PRN_GIOVE_OFFSET;
               }
 
@@ -286,20 +285,12 @@
               // --------------
               else {
-                delete obs;
-                obs = 0;
-              }
-
-              if (obs) {
-                _obsList.push_back(obs);
-              }
-              else {
                 continue;
               }
 
-              obs->GPSWeek  = gnssData.week;
-              obs->GPSWeeks = gnssData.timeofweek / 1000.0;
-
-              QString prn = QString("%1%2").arg(obs->satSys)
-                            .arg(obs->satNum, 2, 10, QChar('0'));
+              obs.GPSWeek  = gnssData.week;
+              obs.GPSWeeks = gnssData.timeofweek / 1000.0;
+
+              QString prn = QString("%1%2").arg(obs.satSys)
+                            .arg(obs.satNum, 2, 10, QChar('0'));
 
               // Handle loss-of-lock flags
@@ -318,5 +309,5 @@
                   _slip_cnt_L1[prn] = 1;
                 }
-                obs->slip_cnt_L1 = _slip_cnt_L1[prn];
+                obs.slip_cnt_L1 = _slip_cnt_L1[prn];
               }
               if (GNSSDF2_LOCKLOSSL2 & gnssData.dataflags2[iSat]) {
@@ -327,5 +318,5 @@
                   _slip_cnt_L2[prn] = 1;
                 }
-                obs->slip_cnt_L2 = _slip_cnt_L2[prn];
+                obs.slip_cnt_L2 = _slip_cnt_L2[prn];
               }
               if (GNSSDF2_LOCKLOSSL5 & gnssData.dataflags2[iSat]) {
@@ -336,5 +327,5 @@
                   _slip_cnt_L5[prn] = 1;
                 }
-                obs->slip_cnt_L5 = _slip_cnt_L5[prn];
+                obs.slip_cnt_L5 = _slip_cnt_L5[prn];
               }
 
@@ -357,65 +348,66 @@
 
                   if      (iEntry == GNSSENTRY_C1DATA) {
-                    obs->C1  = gnssData.measdata[iSat][iEntry];
+                    obs.C1  = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_C2DATA) {
-                    obs->C2  = gnssData.measdata[iSat][iEntry];
+                    obs.C2  = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_P1DATA) {
-                    obs->P1  = gnssData.measdata[iSat][iEntry];
+                    obs.P1  = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_P2DATA) {
-                    obs->P2  = gnssData.measdata[iSat][iEntry];
+                    obs.P2  = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_L1CDATA) {
-                    obs->L1C = gnssData.measdata[iSat][iEntry];
+                    obs.L1C = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_L1PDATA) {
-                    obs->L1P = gnssData.measdata[iSat][iEntry];
+                    obs.L1P = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_L2CDATA) {
-                    obs->L2C = gnssData.measdata[iSat][iEntry];
+                    obs.L2C = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_L2PDATA) {
-                    obs->L2P = gnssData.measdata[iSat][iEntry];
+                    obs.L2P = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_D1CDATA) {
-                    obs->D1C = gnssData.measdata[iSat][iEntry];
+                    obs.D1C = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_D1PDATA) {
-                    obs->D1P = gnssData.measdata[iSat][iEntry];
+                    obs.D1P = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_S1CDATA) {
-                    obs->S1C = gnssData.measdata[iSat][iEntry];
+                    obs.S1C = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_S1PDATA) {
-                    obs->S1P = gnssData.measdata[iSat][iEntry];
+                    obs.S1P = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_D2CDATA) {
-                    obs->D2C = gnssData.measdata[iSat][iEntry];
+                    obs.D2C = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_D2PDATA) {
-                    obs->D2P = gnssData.measdata[iSat][iEntry];
+                    obs.D2P = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_S2CDATA) {
-                    obs->S2C = gnssData.measdata[iSat][iEntry];
+                    obs.S2C = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_S2PDATA) {
-                    obs->S2P = gnssData.measdata[iSat][iEntry];
+                    obs.S2P = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_C5DATA) {
-                    obs->C5  = gnssData.measdata[iSat][iEntry];
+                    obs.C5  = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_L5DATA) {
-                    obs->L5  = gnssData.measdata[iSat][iEntry];
+                    obs.L5  = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_D5DATA) {
-                    obs->D5  = gnssData.measdata[iSat][iEntry];
+                    obs.D5  = gnssData.measdata[iSat][iEntry];
                   }
                   else if (iEntry == GNSSENTRY_S5DATA) {
-                    obs->S5  = gnssData.measdata[iSat][iEntry];
-                  }
-                }
-              }
+                    obs.S5  = gnssData.measdata[iSat][iEntry];
+                  }
+                }
+              }
+              _obsList.push_back(obs);
             }
           }
