Skip to content

Commit 882638f

Browse files
author
Iain Bancarz
committed
Close and delete sim/qc objects before exit
1 parent e7a01d7 commit 882638f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

simtools.cpp

+11-4
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ void commandView(string infile, bool verbose)
197197
free(intensity_int);
198198
free(intensity_float);
199199
delete sampleName;
200+
sim->close();
201+
delete sim;
200202
}
201203

202204
//
@@ -332,6 +334,7 @@ void commandCreate(string infile, string outfile, bool normalize, string manfile
332334

333335
}
334336
sim->close();
337+
delete sim;
335338
}
336339

337340
//
@@ -414,6 +417,8 @@ void commandIlluminus(string infile, string outfile, string manfile, int start_p
414417
}
415418
free(intensity_int);
416419
free(intensity_float);
420+
sim->close();
421+
delete sim;
417422
}
418423

419424
void commandGenoSNP(string infile, string outfile, string manfile, int start_pos, int end_pos, bool verbose)
@@ -449,6 +454,7 @@ void commandGenoSNP(string infile, string outfile, string manfile, int start_pos
449454

450455
free(sampleName);
451456
free(intensity);
457+
sim->close();
452458
delete sim;
453459
}
454460

@@ -464,14 +470,15 @@ void commandQC(string infile, string magnitude, string xydiff, bool verbose)
464470
"--magnitude, --xydiff for QC" << endl;
465471
exit(1);
466472
}
467-
QC myqc = QC(infile, verbose);
473+
QC *qc = new QC(infile, verbose);
468474
if (magnitude!="") {
469-
myqc.writeMagnitude(magnitude, verbose);
475+
qc->writeMagnitude(magnitude, verbose);
470476
}
471477
if (xydiff!="") {
472-
myqc.writeXydiff(xydiff, verbose);
478+
qc->writeXydiff(xydiff, verbose);
473479
}
474-
myqc.close();
480+
qc->close();
481+
delete qc;
475482

476483
}
477484

0 commit comments

Comments
 (0)