Repair a crash when decoding ISCAT

Passing a  auto stack variable to  a future is  not a good idea  as it
will almost certainly  go out of scope before the  future has finished
executing.
This commit is contained in:
Bill Somerville
2019-06-30 12:17:17 +01:00
parent c65d832356
commit adcf202637
2 changed files with 6 additions and 6 deletions
+2 -3
View File
@@ -147,7 +147,7 @@ extern "C" {
float* level, float* sigdb, float* snr, float* dfreq,
float* width);
void fast_decode_(short id2[], int narg[], int* ntrperiod,
void fast_decode_(short id2[], int narg[], double * trperiod,
char msg[], char mycall[], char hiscall[],
fortran_charlen_t, fortran_charlen_t, fortran_charlen_t);
void degrade_snr_(short d2[], int* n, float* db, float* bandwidth);
@@ -2965,10 +2965,9 @@ void MainWindow::decode() //decode()
narg[12]=0;
narg[13]=-1;
narg[14]=m_config.aggressive();
int nTRperiod=m_TRperiod;
memcpy(d2b,dec_data.d2,2*360000);
watcher3.setFuture (QtConcurrent::run (std::bind (fast_decode_,&d2b[0],
&narg[0],&nTRperiod,&m_msg[0][0],
&narg[0],&m_TRperiod,&m_msg[0][0],
dec_data.params.mycall,dec_data.params.hiscall,8000,12,12)));
} else {
memcpy(to, from, qMin(mem_jt9->size(), size));