Skip to content

Commit 9a4a462

Browse files
committed
move teardown function to the correct place
1 parent cb1a21a commit 9a4a462

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

source/source_esolver/esolver_ks_pw.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,6 @@ ESolver_KS_PW<T, Device>::~ESolver_KS_PW()
5454
// delete Hamilt
5555
this->deallocate_hamilt();
5656

57-
elecstate::teardown_estate_pw<T, Device>(this->pelec, this->vsep_cell);
58-
59-
/*
60-
if (vsep_cell != nullptr)
61-
{
62-
delete vsep_cell;
63-
}
64-
65-
if (this->pelec != nullptr)
66-
{
67-
delete reinterpret_cast<elecstate::ElecStatePW<T, Device>*>(this->pelec);
68-
this->pelec = nullptr;
69-
}
70-
*/
71-
7257

7358
if (PARAM.inp.device == "gpu" || PARAM.inp.precision == "single")
7459
{
@@ -622,6 +607,8 @@ void ESolver_KS_PW<T, Device>::after_all_runners(UnitCell& ucell)
622607
this->pw_rho, this->pw_rhod, this->chr, this->kv, this->psi,
623608
this->kspw_psi, this->__kspw_psi, this->sf,
624609
this->ppcell, this->solvent, this->ctx, this->Pgrid, PARAM.inp);
610+
611+
elecstate::teardown_estate_pw<T, Device>(this->pelec, this->vsep_cell);
625612

626613
}
627614

0 commit comments

Comments
 (0)