diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-11-24 17:07:22 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-24 17:07:22 -0500 |
| commit | 233635c9324ca2ed3ca6ba1231ac5c73facb9fb2 (patch) | |
| tree | 746d265e26200d777d3307293df97718e870258d /source/core/slang-rtti-info.cpp | |
| parent | 7db340b75e7bf31e5a1e3ac1a3b4c651c6087f92 (diff) | |
Fix for slang-test memory leak (#2029)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Fix memory leak due to Rtti usage.
Diffstat (limited to 'source/core/slang-rtti-info.cpp')
| -rw-r--r-- | source/core/slang-rtti-info.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/core/slang-rtti-info.cpp b/source/core/slang-rtti-info.cpp index f53cf742f..043e6490a 100644 --- a/source/core/slang-rtti-info.cpp +++ b/source/core/slang-rtti-info.cpp @@ -39,6 +39,11 @@ struct RttiInfoManager std::lock_guard<std::recursive_mutex> guard(m_mutex); return m_arena.allocate(size); } + void deallocateAll() + { + std::lock_guard<std::recursive_mutex> guard(m_mutex); + m_arena.reset(); + } static RttiInfoManager& getSingleton() { @@ -61,6 +66,11 @@ protected: return RttiInfoManager::getSingleton().allocate(size); } +/* static */void RttiInfo::deallocateAll() +{ + return RttiInfoManager::getSingleton().deallocateAll(); +} + /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! StructRttiBuilder !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ static void _appendFixedArray(const FixedArrayRttiInfo* inFixedArray, StringBuilder& out) |
