Skip to content

Commit 4eda1bb

Browse files
committed
Fix possible circular notification
1 parent bb355ea commit 4eda1bb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

ql/termstructures/yield/oisratehelper.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ namespace QuantLib {
5151

5252
overnightIndex_ =
5353
ext::dynamic_pointer_cast<OvernightIndex>(overnightIndex->clone(termStructureHandle_));
54+
// We want to be notified of changes of fixings, but we don't
55+
// want notifications from termStructureHandle_ (they would
56+
// interfere with bootstrapping.)
57+
overnightIndex_->unregisterWith(termStructureHandle_);
5458

5559
registerWith(overnightIndex_);
5660
registerWith(discountHandle_);
@@ -161,6 +165,10 @@ namespace QuantLib {
161165

162166
auto clonedOvernightIndex =
163167
ext::dynamic_pointer_cast<OvernightIndex>(overnightIndex->clone(termStructureHandle_));
168+
// We want to be notified of changes of fixings, but we don't
169+
// want notifications from termStructureHandle_ (they would
170+
// interfere with bootstrapping.)
171+
clonedOvernightIndex->unregisterWith(termStructureHandle_);
164172

165173
registerWith(clonedOvernightIndex);
166174
registerWith(discountHandle_);

0 commit comments

Comments
 (0)