File tree Expand file tree Collapse file tree 4 files changed +7
-10
lines changed Expand file tree Collapse file tree 4 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ void Driver::atomic_world(void)
9393 // lcao: linear combination of atomic orbitals
9494 // --------------------------------------------------
9595 string use_ensol;
96- ModuleESolver::ESolver *p_esolver;
96+ ModuleESolver::ESolver *p_esolver = nullptr ;
9797 if (GlobalV::BASIS_TYPE==" pw" || GlobalV::BASIS_TYPE==" lcao_in_pw" )
9898 {
9999 if (GlobalV::CALCULATION.substr (0 ,3 ) == " sto" ) use_ensol = " sdft_pw" ;
Original file line number Diff line number Diff line change @@ -45,10 +45,7 @@ namespace ModuleESolver
4545
4646 void clean_esolver (ESolver*& pesolver)
4747 {
48- if (pesolver != nullptr )
49- {
50- delete pesolver;
51- }
48+ delete pesolver;
5249 }
5350
5451}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ namespace ModuleESolver
1414 }
1515 ESolver_FP::~ESolver_FP ()
1616 {
17- if (pw_rho!= nullptr ) delete pw_rho;
17+ delete pw_rho;
1818 }
1919 void ESolver_FP::Init (Input& inp, UnitCell_pseudo& cell)
2020 {
Original file line number Diff line number Diff line change @@ -38,10 +38,10 @@ namespace ModuleESolver
3838
3939 ESolver_KS::~ESolver_KS ()
4040 {
41- if ( this -> pw_wfc != nullptr ) delete this ->pw_wfc ;
42- if ( this -> pelec != nullptr ) delete this ->pelec ;
43- if ( this -> phami != nullptr ) delete this ->phami ;
44- if ( this -> phsol != nullptr ) delete this ->phsol ;
41+ delete this ->pw_wfc ;
42+ delete this ->pelec ;
43+ delete this ->phami ;
44+ delete this ->phsol ;
4545 }
4646
4747 void ESolver_KS::Init (Input& inp, UnitCell_pseudo& ucell)
You can’t perform that action at this time.
0 commit comments