Avoid accessing shared memory after it has been deleted

This commit is contained in:
Bill Somerville 2020-08-11 20:07:00 +01:00
parent e27b09b590
commit 185f570136
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F

View File

@ -3137,7 +3137,8 @@ void MainWindow::decode() //decode()
//newdat=1 ==> this is new data, must do the big FFT
//nagain=1 ==> decode only at fQSO +/- Tol
char *to = (char*)mem_jt9->data();
if (auto * to = reinterpret_cast<char *> (mem_jt9->data()))
{
char *from = (char*) dec_data.ipc;
int size=sizeof(struct dec_data);
if(dec_data.params.newdat==0) {
@ -3187,6 +3188,7 @@ void MainWindow::decode() //decode()
to_jt9(m_ihsym,1,-1); //Send m_ihsym to jt9[.exe] and start decoding
decodeBusy(true);
}
}
}
void::MainWindow::fast_decode_done()
@ -3234,12 +3236,14 @@ void::MainWindow::fast_decode_done()
void MainWindow::to_jt9(qint32 n, qint32 istart, qint32 idone)
{
dec_data_t * dd = reinterpret_cast<dec_data_t *> (mem_jt9->data());
if (auto * dd = reinterpret_cast<dec_data_t *> (mem_jt9->data()))
{
mem_jt9->lock ();
dd->ipc[0]=n;
if(istart>=0) dd->ipc[1]=istart;
if(idone>=0) dd->ipc[2]=idone;
mem_jt9->unlock ();
}
}
void MainWindow::decodeDone ()