From dba8b362221188c4e3125e39eb0654613a7d3dd2 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Mon, 23 May 2022 14:44:48 +0200 Subject: De/fix namespace folder scanning (#103) --- zenserver/cache/structuredcachestore.cpp | 2 +- zenstore/gc.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp index da948fd72..7509c5a71 100644 --- a/zenserver/cache/structuredcachestore.cpp +++ b/zenserver/cache/structuredcachestore.cpp @@ -2141,7 +2141,7 @@ ZenCacheStore::ZenCacheStore(CasGc& Gc, std::filesystem::path BasePath) : GcStor std::vector Namespaces; for (const std::filesystem::path& DirPath : DirContent.Directories) { - std::string DirName = PathToUtf8(DirPath.stem()); + std::string DirName = PathToUtf8(DirPath.filename()); if (DirName.starts_with(NamespaceDiskPrefix)) { Namespaces.push_back(DirName.substr(NamespaceDiskPrefix.length())); diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp index 4b50668d9..8e2d441f8 100644 --- a/zenstore/gc.cpp +++ b/zenstore/gc.cpp @@ -343,7 +343,7 @@ GcStorage::GcStorage(CasGc& Gc) : m_Gc(Gc) GcStorage::~GcStorage() { - m_Gc.AddGcStorage(this); + m_Gc.RemoveGcStorage(this); } ////////////////////////////////////////////////////////////////////////// @@ -373,6 +373,7 @@ CasGc::RemoveGcContributor(GcContributor* Contributor) void CasGc::AddGcStorage(GcStorage* Storage) { + ZEN_ASSERT(Storage != nullptr); RwLock::ExclusiveLockScope _(m_Lock); m_GcStorage.push_back(Storage); } -- cgit v1.2.3