summaryrefslogtreecommitdiff
path: root/lib/backupstore/BackupStoreContext.h
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-11-16 23:12:06 +0000
committerChris Wilson <chris+github@qwirx.com>2014-11-16 23:12:06 +0000
commit258e57eaecfe85356181706d70141a2563d22737 (patch)
treef1b64fd4d00a7b39ec062869dc97897f091d9b57 /lib/backupstore/BackupStoreContext.h
parent286c37b195f15236ccb0f51fd912777c17a2e2db (diff)
Add cache invalidation checks to BackupStoreDirectory.
Allows us to catch programming errors related to use of a cached reference to a directory after the cache may have been invalidated by requesting another directory from the cache, which could clear it. In DEBUG builds, the cache is no longer cleared, but any entries in it are invalidated, which is effectively a memory leak, but these builds should only be used for running tests, where it doesn't matter.
Diffstat (limited to 'lib/backupstore/BackupStoreContext.h')
-rw-r--r--lib/backupstore/BackupStoreContext.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/backupstore/BackupStoreContext.h b/lib/backupstore/BackupStoreContext.h
index ffbc1e96..21488526 100644
--- a/lib/backupstore/BackupStoreContext.h
+++ b/lib/backupstore/BackupStoreContext.h
@@ -176,7 +176,8 @@ public:
private:
void MakeObjectFilename(int64_t ObjectID, std::string &rOutput, bool EnsureDirectoryExists = false);
- BackupStoreDirectory &GetDirectoryInternal(int64_t ObjectID);
+ BackupStoreDirectory &GetDirectoryInternal(int64_t ObjectID,
+ bool AllowFlushCache = true);
void SaveDirectory(BackupStoreDirectory &rDir);
void RemoveDirectoryFromCache(int64_t ObjectID);
void ClearDirectoryCache();