diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index b8b2d7b038..616a712f38 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -823,21 +823,21 @@ int main( int argc, char **argv ) { } #endif*/ - printf("stopping MODEM threads\n"); - // cleanup - stop_gNB(NB_gNB_INST); - if (RC.nb_nr_L1_inst > 0) { - stop_RU(NB_RU); - } + // cleanup + if (RC.nb_nr_L1_inst > 0) + stop_gNB(RC.nb_nr_L1_inst); + + if (RC.nb_RU > 0) + stop_RU(RC.nb_RU); /* release memory used by the RU/gNB threads (incomplete), after all * threads have been stopped (they partially use the same memory) */ - for (int inst = 0; inst < NB_RU; inst++) { + for (int inst = 0; inst < RC.nb_RU; inst++) { nr_phy_free_RU(RC.ru[inst]); } - for (int inst = 0; inst < NB_gNB_INST; inst++) { + for (int inst = 0; inst < RC.nb_nr_L1_inst; inst++) { phy_free_nr_gNB(RC.gNB[inst]); } @@ -849,7 +849,7 @@ int main( int argc, char **argv ) { // *** Handle per CC_id openair0 - for(ru_id=0; ru_idifdevice.trx_end_func) RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice); }