Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 31ac2eb

Browse files
iomaganarispramodk
authored andcommitted
Moved deletion of nrnthread_chkpnt to nrn_cleanup to avoid segmentation (#188)
- segfault when accessing it in write_phase2 of nrn_checkpoint.cpp - introduced with f776393
1 parent 9fff9e0 commit 31ac2eb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

coreneuron/nrniv/nrn_setup.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -821,10 +821,6 @@ void nrn_setup(const char* filesdat,
821821
model_size();
822822
delete [] gidgroups;
823823
delete [] imult;
824-
if (nrnthread_chkpnt) {
825-
delete [] nrnthread_chkpnt;
826-
nrnthread_chkpnt = NULL;
827-
}
828824

829825
if (nrnmpi_myid == 0) {
830826
printf(" Setup Done : %.2lf seconds \n", nrn_wtime() - time);
@@ -1009,6 +1005,12 @@ void nrn_cleanup(bool clean_ion_global_map) {
10091005
gid2in.clear();
10101006
gid2out.clear();
10111007

1008+
// clean nrnthread_chkpnt
1009+
if (nrnthread_chkpnt) {
1010+
delete [] nrnthread_chkpnt;
1011+
nrnthread_chkpnt = nullptr;
1012+
}
1013+
10121014
// clean ezOpt parser allocated memory (if any)
10131015
nrnopt_delete();
10141016

0 commit comments

Comments
 (0)