fix memory leak in test
This commit is contained in:
@ -446,10 +446,10 @@ TEST(FixTimestep, plain)
|
|||||||
!utils::strmatch(ifix->style, "^nve/limit") && !utils::strmatch(ifix->style, "^recenter")) {
|
!utils::strmatch(ifix->style, "^nve/limit") && !utils::strmatch(ifix->style, "^recenter")) {
|
||||||
if (!verbose) ::testing::internal::CaptureStdout();
|
if (!verbose) ::testing::internal::CaptureStdout();
|
||||||
cleanup_lammps(lmp, test_config);
|
cleanup_lammps(lmp, test_config);
|
||||||
|
delete lmp;
|
||||||
if (!verbose) ::testing::internal::GetCapturedStdout();
|
if (!verbose) ::testing::internal::GetCapturedStdout();
|
||||||
|
|
||||||
::testing::internal::CaptureStdout();
|
::testing::internal::CaptureStdout();
|
||||||
LAMMPS *lmp = nullptr;
|
|
||||||
try {
|
try {
|
||||||
lmp = init_lammps(args, test_config, true);
|
lmp = init_lammps(args, test_config, true);
|
||||||
} catch (std::exception &e) {
|
} catch (std::exception &e) {
|
||||||
@ -758,6 +758,7 @@ TEST(FixTimestep, omp)
|
|||||||
|
|
||||||
if (!verbose) ::testing::internal::CaptureStdout();
|
if (!verbose) ::testing::internal::CaptureStdout();
|
||||||
cleanup_lammps(lmp, test_config);
|
cleanup_lammps(lmp, test_config);
|
||||||
|
delete lmp;
|
||||||
if (!verbose) ::testing::internal::GetCapturedStdout();
|
if (!verbose) ::testing::internal::GetCapturedStdout();
|
||||||
|
|
||||||
::testing::internal::CaptureStdout();
|
::testing::internal::CaptureStdout();
|
||||||
|
|||||||
Reference in New Issue
Block a user