Index: trunk/BNC/src/combination/bnccomb.cpp
===================================================================
--- trunk/BNC/src/combination/bnccomb.cpp	(revision 6330)
+++ trunk/BNC/src/combination/bnccomb.cpp	(revision 6443)
@@ -127,5 +127,5 @@
 // Constructor
 ////////////////////////////////////////////////////////////////////////////
-bncComb::bncComb() : bncEphUser(true) {
+bncComb::bncComb() : _ephUser(true) {
 
   bncSettings settings;
@@ -382,5 +382,7 @@
     // Check the Ephemeris
     //--------------------
-    if (_eph.find(prn) == _eph.end()) {
+    const t_eph* ephLast = _ephUser.ephLast(prn);
+    const t_eph* ephPrev = _ephUser.ephPrev(prn);
+    if (ephLast == 0) {
       emit newMessage("bncComb: eph not found "  + prn.toAscii(), true);
       delete newCorr;
@@ -388,12 +390,10 @@
     }
     else {
-      t_eph* lastEph = _eph[prn]->last;
-      t_eph* prevEph = _eph[prn]->prev;
-      if      (lastEph && lastEph->IOD() == newCorr->_iod) {
-        newCorr->_eph = lastEph;
-      }
-      else if (lastEph && prevEph && prevEph->IOD() == newCorr->_iod) {
-        newCorr->_eph = prevEph;
-        switchToLastEph(lastEph, newCorr);
+      if      (ephLast->IOD() == newCorr->_iod) {
+        newCorr->_eph = ephLast;
+      }
+      else if (ephPrev && ephPrev->IOD() == newCorr->_iod) {
+        newCorr->_eph = ephPrev;
+        switchToLastEph(ephLast, newCorr);
       }
       else {
@@ -1051,5 +1051,9 @@
     cmbCorr* corr = im.next();
     QString  prn  = corr->_prn;
-    if      (_eph.find(prn) == _eph.end()) {
+
+    const t_eph* ephLast = _ephUser.ephLast(prn);
+    const t_eph* ephPrev = _ephUser.ephPrev(prn);
+
+    if      (ephLast == 0) {
       out << "checkOrbit: missing eph (not found) " << corr->_prn << endl;
       delete corr;
@@ -1062,6 +1066,6 @@
     }
     else {
-      if ( corr->_eph == _eph[prn]->last || corr->_eph == _eph[prn]->prev ) {
-        switchToLastEph(_eph[prn]->last, corr);
+      if ( corr->_eph == ephLast || corr->_eph == ephPrev ) {
+        switchToLastEph(ephLast, corr);
       }
       else {
Index: trunk/BNC/src/combination/bnccomb.h
===================================================================
--- trunk/BNC/src/combination/bnccomb.h	(revision 6330)
+++ trunk/BNC/src/combination/bnccomb.h	(revision 6443)
@@ -12,5 +12,5 @@
 class bncAntex;
 
-class bncComb : public bncEphUser  {
+class bncComb : public QObject {
  Q_OBJECT
  public:
@@ -108,4 +108,5 @@
   QVector<cmbCorr*>& corrs() {return _buffer[_resTime].corrs;}
 
+  QMutex                                 _mutex;
   QList<cmbAC*>                          _ACs;
   bncTime                                _resTime;
@@ -123,4 +124,5 @@
   int                                    _cmbSampl;
   QMap<QString, QMap<t_prn, t_orbCorr> > _orbCorrections;
+  bncEphUser                             _ephUser;
 };
 
