File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -392,6 +392,12 @@ struct ReadHandleImpl {
392392 }
393393 }
394394
395+ protected:
396+ friend class ReadHandleImpl ;
397+ // Method used only by ReadHandleImpl ctor
398+ void discard () {
399+ it_.store (nullptr , std::memory_order_relaxed);
400+ }
395401 private:
396402 // we are waiting on Item* to be set to a value. One of the valid values is
397403 // nullptr. So choose something that we dont expect to indicate a ptr
@@ -475,6 +481,7 @@ struct ReadHandleImpl {
475481 if (it_ && it_->isIncomplete ()) {
476482 waitContext_ = std::make_shared<ItemWaitContext>(alloc);
477483 if (!alloc_->addWaitContextForMovingItem (it->getKey (), waitContext_)) {
484+ waitContext_->discard ();
478485 waitContext_.reset ();
479486 }
480487 }
You can’t perform that action at this time.
0 commit comments