Clean up ekind struct
[alexxy/gromacs.git] / src / gromacs / mdrun / rerun.cpp
index ae2e3fd2ecf35b4fa912c037d42721d62efb3c81..a1af5fefefb2b92d0cc79b13d7c78bef25edcf66 100644 (file)
@@ -212,7 +212,6 @@ void gmx::Integrator::do_rerun()
     gmx_global_stat_t       gstat;
     t_graph                *graph = nullptr;
     gmx_groups_t           *groups;
-    gmx_ekindata_t         *ekind;
     gmx_shellfc_t          *shellfc;
 
     double                  cycles;
@@ -306,7 +305,8 @@ void gmx::Integrator::do_rerun()
                   enerd);
 
     /* Kinetic energy data */
-    snew(ekind, 1);
+    std::unique_ptr<gmx_ekindata_t> eKinData = compat::make_unique<gmx_ekindata_t>();
+    gmx_ekindata_t                 *ekind    = eKinData.get();
     init_ekindata(fplog, top_global, &(ir->opts), ekind);
     /* Copy the cos acceleration to the groups struct */
     ekind->cosacc.cos_accel = ir->cos_accel;