Skip to content

Commit d1333a7

Browse files
committed
Fix order of deinitialization
1 parent 644cbee commit d1333a7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/colvarmodule.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,8 +1311,6 @@ colvarmodule::~colvarmodule()
13111311
colvar::cvc::delete_features();
13121312
atom_group::delete_features();
13131313

1314-
colvar_components_.clear();
1315-
13161314
// The proxy object will be deallocated last (if at all)
13171315
proxy = nullptr;
13181316
}
@@ -1333,6 +1331,9 @@ int colvarmodule::reset()
13331331
biases_active_.clear();
13341332
num_biases_types_used_.clear();
13351333

1334+
// Clear the global map first, after which each colvar takes down its own CVCs
1335+
colvar_components_.clear();
1336+
13361337
// Iterate backwards because we are deleting the elements as we go
13371338
while (!colvars.empty()) {
13381339
colvar* cvi = colvars.back();

0 commit comments

Comments
 (0)