Skip to content

Commit

Permalink
Fix order of deinitialization
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomofiorin committed Feb 21, 2024
1 parent 644cbee commit d1333a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/colvarmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1311,8 +1311,6 @@ colvarmodule::~colvarmodule()
colvar::cvc::delete_features();
atom_group::delete_features();

colvar_components_.clear();

// The proxy object will be deallocated last (if at all)
proxy = nullptr;
}
Expand All @@ -1333,6 +1331,9 @@ int colvarmodule::reset()
biases_active_.clear();
num_biases_types_used_.clear();

// Clear the global map first, after which each colvar takes down its own CVCs
colvar_components_.clear();

// Iterate backwards because we are deleting the elements as we go
while (!colvars.empty()) {
colvar* cvi = colvars.back();
Expand Down

0 comments on commit d1333a7

Please sign in to comment.