Skip to content

Commit

Permalink
Merge pull request cyclus#1806 from nuclearkatie/packaging
Browse files Browse the repository at this point in the history
ResTracker Extract gave the wrong parent_id to one of the child resources
  • Loading branch information
gonuke authored Sep 24, 2024
2 parents 6ac62fb + 8b3f1e2 commit bde9307
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Since last release
* Removed GTest source code from code coverage reports (#1759)
* Updated action versions to avoid node.js deprecation (#1802)
* Removed the module imports in `cyclus/__init__.py` and removed the need for multi-phase initialization of Cython modules (#1809)
* ResTracker Extract gave the wrong parent_id to one of the child resources (#1806)


v1.6.0
Expand Down
10 changes: 7 additions & 3 deletions src/res_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,19 @@ void ResTracker::Extract(ResTracker* removed) {
if (res_->quantity() > eps_rsrc()) {
parent1_ = res_->state_id();
parent2_ = 0;

Record();
}

// removed parent must be set before the resource is recorded, otherwise
// removed ends up with parent1 of the other child (which is this resource
// after being bumped)
removed->parent1_ = res_->state_id();
removed->parent2_ = 0;
removed->tracked_ = tracked_;

removed->Record();

if (res_->quantity() > eps_rsrc()) {
Record();
}
}

void ResTracker::Absorb(ResTracker* absorbed) {
Expand Down

0 comments on commit bde9307

Please sign in to comment.