mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 06:47:41 +03:00
Move ProjFS enumerator into getEnumerationData callback
Summary: Even though we only need the Enumeration in the future's callback, if we don't move the Enumerator it can get dereferenced while we're awaiting the future returned by prepareEnumeration(). Reviewed By: xavierd Differential Revision: D44770398 fbshipit-source-id: a9fc91c0766b4a9f43f566887d714cbde66b1cf3
This commit is contained in:
parent
7afc5962ef
commit
b260939c66
@ -490,8 +490,10 @@ HRESULT PrjfsChannelInner::getEnumerationData(
|
||||
context->startRequest(getStats().copy(), stat, requestWatch);
|
||||
|
||||
return enumerator->prepareEnumeration().thenValue(
|
||||
[buffer, context = std::move(context)](
|
||||
std::shared_ptr<Enumeration> enumeration) {
|
||||
[buffer,
|
||||
context = std::move(context),
|
||||
enumerator =
|
||||
std::move(enumerator)](std::shared_ptr<Enumeration> enumeration) {
|
||||
bool added = false;
|
||||
for (auto optEntry = enumeration->getCurrent(); optEntry.has_value();
|
||||
optEntry = enumeration->getNext()) {
|
||||
|
Loading…
Reference in New Issue
Block a user