diff --git a/src/navigation.cpp b/src/navigation.cpp
index cfba893fabc47292bf3dbad1bfc344b2f3627536..ed095bce883dc8711cc207c25acde1d725d29067 100644
--- a/src/navigation.cpp
+++ b/src/navigation.cpp
@@ -41,23 +41,32 @@ void Navigation::freeNavigation()
 }
 
 void Navigation::clearNavigation()
-{  
-  nav_.eph =NULL;
-  nav_.geph=NULL;
-  nav_.seph=NULL;
-  nav_.peph=NULL;
-  nav_.pclk=NULL;
-  nav_.alm =NULL;
-  nav_.tec =NULL;
-  nav_.fcb =NULL;
-  nav_.n =nav_.nmax =0;
-  nav_.ng=nav_.ngmax=0;
-  nav_.ns=nav_.nsmax=0;
-  nav_.ne=nav_.nemax=0;
-  nav_.nc=nav_.ncmax=0;
-  nav_.na=nav_.namax=0;
-  nav_.nt=nav_.ntmax=0;
-  nav_.nf=nav_.nfmax=0;
+{
+    // inspire from RTKLIB:
+    //    if (opt&0x01) {free(nav->eph ); nav->eph =NULL; nav->n =nav->nmax =0;}
+    //    if (opt&0x02) {free(nav->geph); nav->geph=NULL; nav->ng=nav->ngmax=0;}
+    //    if (opt&0x04) {free(nav->seph); nav->seph=NULL; nav->ns=nav->nsmax=0;}
+    //    if (opt&0x08) {free(nav->peph); nav->peph=NULL; nav->ne=nav->nemax=0;}
+    //    if (opt&0x10) {free(nav->pclk); nav->pclk=NULL; nav->nc=nav->ncmax=0;}
+    //    if (opt&0x20) {free(nav->alm ); nav->alm =NULL; nav->na=nav->namax=0;}
+    //    if (opt&0x40) {free(nav->tec ); nav->tec =NULL; nav->nt=nav->ntmax=0;}
+    //    if (opt&0x80) {free(nav->fcb ); nav->fcb =NULL; nav->nf=nav->nfmax=0;}
+    nav_.eph =NULL;
+    nav_.geph=NULL;
+    nav_.seph=NULL;
+    nav_.peph=NULL;
+    nav_.pclk=NULL;
+    nav_.alm =NULL;
+    nav_.tec =NULL;
+    nav_.fcb =NULL;
+    nav_.n =nav_.nmax =0;
+    nav_.ng=nav_.ngmax=0;
+    nav_.ns=nav_.nsmax=0;
+    nav_.ne=nav_.nemax=0;
+    nav_.nc=nav_.ncmax=0;
+    nav_.na=nav_.namax=0;
+    nav_.nt=nav_.ntmax=0;
+    nav_.nf=nav_.nfmax=0;
 }
 
 void Navigation::setNavigation(nav_t _nav)