rf_imp.c: fix segfault when closing RF device with no AGC thread

This commit is contained in:
Robert Falkenberg 2021-10-06 14:53:27 +02:00 committed by Andre Puschmann
parent a066236a96
commit b0430ebfe2
1 changed files with 3 additions and 1 deletions

View File

@ -181,7 +181,9 @@ int srsran_rf_close(srsran_rf_t* rf)
}
pthread_mutex_unlock(&rf->mutex);
pthread_cond_signal(&rf->cond);
pthread_join(rf->thread_gain, NULL);
if (rf->thread_gain) {
pthread_join(rf->thread_gain, NULL);
}
return ((rf_dev_t*)rf->dev)->srsran_rf_close(rf->handler);
}