mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-12-24 11:40:31 -05:00
Avoid accessing shared memory after it has been deleted
This commit is contained in:
parent
e27b09b590
commit
185f570136
@ -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) {
|
||||
@ -3188,6 +3189,7 @@ void MainWindow::decode() //decode()
|
||||
decodeBusy(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void::MainWindow::fast_decode_done()
|
||||
{
|
||||
@ -3234,13 +3236,15 @@ 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 ()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user