Skip to content

Commit

Permalink
Backport fix for MSVC issue from GROMACS 2024
Browse files Browse the repository at this point in the history
Since this is pre-release, it is preferable not to change the Colvars version
string yet.  Future bugfixes for GROMACS 2024 should require that, though.
  • Loading branch information
giacomofiorin committed Jan 11, 2024
1 parent 308e88b commit cac51a1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/colvarmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1301,10 +1301,10 @@ int colvarmodule::reset()
parse->clear();

// Iterate backwards because we are deleting the elements as we go
for (std::vector<colvarbias *>::reverse_iterator bi = biases.rbegin();
bi != biases.rend();
bi++) {
delete *bi; // the bias destructor updates the biases array
while (!biases.empty()) {
colvarbias* tail = biases.back();
biases.pop_back();
delete tail; // the bias destructor updates the biases array
}
biases.clear();
biases_active_.clear();
Expand All @@ -1313,11 +1313,11 @@ int colvarmodule::reset()
reinterpret_cast<std::map<std::string, int> *>(num_biases_types_used_)->clear();

// Iterate backwards because we are deleting the elements as we go
for (std::vector<colvar *>::reverse_iterator cvi = colvars.rbegin();
cvi != colvars.rend();
cvi++) {
delete *cvi; // the colvar destructor updates the colvars array
}
while (!colvars.empty()) {
colvar* cvi = colvars.back();
colvars.pop_back();
delete cvi; // the colvar destructor updates the colvars array
};
colvars.clear();

reset_index_groups();
Expand Down

0 comments on commit cac51a1

Please sign in to comment.