1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-15 09:01:12 +01:00

Manage block files with std::shared_ptr, BlockHash stores weak_ptr

This commit is contained in:
Paul Licameli
2016-08-16 10:52:43 -04:00
parent 84ccdca5c3
commit 8b72bd2f92
14 changed files with 51 additions and 230 deletions

View File

@@ -94,10 +94,6 @@ static void ReplaceBlockFiles(AudacityProject *project,
const auto src = &*f;
if (hash.count( src ) > 0) {
const auto &dst = hash[src];
dirManager->Deref(src);
dirManager->Ref(dst);
f = dst;
}
}
@@ -223,11 +219,6 @@ static void RemoveDependencies(AudacityProject *project,
// However, that didn't actually change any references to these
// blockfiles in the Sequences, so we do that next...
ReplaceBlockFiles(project, blockFileHash);
// Subtract one from reference count of NEW block files; they're
// now all referenced the proper number of times by the Sequences
for (const auto &pair : blockFileHash)
dirManager->Deref(pair.second);
}
//