Deallocate the sw array on program exit.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8417 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2018-01-17 17:56:01 +00:00
parent da44098522
commit 9381a13388
2 changed files with 12 additions and 1 deletions

View File

@ -1,11 +1,15 @@
subroutine plotsave(swide,nw,nh,irow)
parameter (NSMAX=6827,NYMAX=64)
real, dimension(:,:), allocatable :: sw
real swide(0:nw-1)
data nw0/-1/,nh0/-1/
save nw0,nh0,sw
if(irow.eq.-99) then
if(allocated(sw)) deallocate(sw)
return
endif
if(nw.ne.nw0 .or. nh.ne.nh0) then
if(nw0.ne.-1) deallocate(sw)
allocate(sw(0:nw-1,0:nh-1))

View File

@ -136,6 +136,8 @@ extern "C" {
double* sigmaa, double* sigmab, int* irc, int len1);
void foxgen_();
void plotsave_(float swide[], int* m_w , int* m_h1, int* irow);
}
int volatile itone[NUM_ISCAT_SYMBOLS]; //Audio tones for all Tx symbols
@ -2107,6 +2109,11 @@ void MainWindow::closeEvent(QCloseEvent * e)
m_shortcuts.reset ();
m_mouseCmnds.reset ();
if(m_mode!="MSK144" and m_mode!="FT8") killFile();
float sw=0.0;
int nw=400;
int nh=100;
int irow=-99;
plotsave_(&sw,&nw,&nh,&irow);
mem_jt9->detach();
QFile quitFile {m_config.temp_dir ().absoluteFilePath (".quit")};
quitFile.open(QIODevice::ReadWrite);