Force evaluation of any lazy structured data on fatal error

This commit is contained in:
baldurk
2025-11-11 16:59:42 +00:00
parent 8128ea0e0f
commit 4e215518df
2 changed files with 21 additions and 0 deletions
+19
View File
@@ -1043,6 +1043,13 @@ protected:
}
}
void Detach()
{
PopulateAllChildren();
for(size_t i = 0; i < data.children.size(); i++)
data.children[i]->Detach();
}
void PopulateAllChildren() const
{
if(m_Lazy)
@@ -1087,6 +1094,9 @@ private:
template <class SerialiserType>
friend void DoSerialise(SerialiserType &ser, SDObject &el, StructuredObjectList &children);
// SDFile should be a friend so it can detach
friend struct SDFile;
void DeleteLazyGenerator() const
{
if(m_Lazy)
@@ -1653,6 +1663,15 @@ public:
std::swap(version, other.version);
}
DOCUMENT(R"(Prepares the SDFile to remove any possible dependencies on what
created it.
)");
void Detach()
{
for(SDChunk *c : chunks)
c->Detach();
}
protected:
SDFile(const SDFile &) = delete;
SDFile &operator=(const SDFile &) = delete;
+2
View File
@@ -44,6 +44,8 @@ DummyDriver::DummyDriver(IReplayDriver *original, const rdcarray<const ShaderRef
m_WindowSystems = original->GetSupportedWindowSystems();
m_CustomEncodings = original->GetCustomShaderEncodings();
m_CustomPrefixes = original->GetCustomShaderSourcePrefixes();
sdfile->Detach();
}
DummyDriver::~DummyDriver()