Fixed an issue where an ACTOR outlives an object passed to it and then crashes while accessing it.
This commit is contained in:
parent
313e823629
commit
986b73f458
|
@ -56,10 +56,11 @@ template<> Tuple Codec<ERestoreState>::pack(ERestoreState const &val) { return T
|
|||
template<> ERestoreState Codec<ERestoreState>::unpack(Tuple const &val) { return (ERestoreState)val.getInt(0); }
|
||||
|
||||
ACTOR Future<std::vector<KeyBackedTag>> TagUidMap::getAll_impl(TagUidMap *tagsMap, Reference<ReadYourWritesTransaction> tr) {
|
||||
state Key prefix = tagsMap->prefix; // Copying it here as tagsMap lifetime is not tied to this actor
|
||||
TagMap::PairsType tagPairs = wait(tagsMap->getRange(tr, std::string(), {}, 1e6));
|
||||
std::vector<KeyBackedTag> results;
|
||||
for(auto &p : tagPairs)
|
||||
results.push_back(KeyBackedTag(p.first, tagsMap->prefix));
|
||||
results.push_back(KeyBackedTag(p.first, prefix));
|
||||
return results;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue