Skip to content

Commit b9c33e9

Browse files
committed
fixed unmounting builtins
1 parent c10e4cf commit b9c33e9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/nbl/system/ISystem.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,14 @@ void ISystem::unmountBuiltins() {
310310

311311
auto removeByKey = [&, this](const char* s) {
312312
auto range = m_cachedArchiveFiles.findRange(s);
313+
std::vector<core::smart_refctd_ptr<IFileArchive>> items_to_remove = {}; //is it always just 1 item?
313314
for (auto it = range.begin(); it != range.end(); ++it)
314315
{
315-
unmount(it->second.get(), s);
316+
items_to_remove.push_back(it->second);
317+
}
318+
for (size_t i = 0; i < items_to_remove.size(); i++)
319+
{
320+
m_cachedArchiveFiles.removeObject(items_to_remove[i], s);
316321
}
317322
};
318323
removeByKey("nbl/builtin");

tools/ndt/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class ShaderCompiler final : public system::IApplicationFramework
6363
m_logger->log("Unmounting builtins.");
6464
m_system->unmountBuiltins();
6565
no_nbl_builtins = true;
66+
m_arguments.erase(m_arguments.begin() + i - 1);
6667
}
6768
else if (argv[i] == "-Fo")
6869
{

0 commit comments

Comments
 (0)