diff options
| author | Yong He <yonghe@outlook.com> | 2024-07-24 11:44:13 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-24 11:44:13 -0700 |
| commit | 657213f13d49f0d2caaa8b64c1245ec8c75fc4d7 (patch) | |
| tree | 02f2a6dca56ea384c88095e75b24691d5253d204 /source/slang/slang-api.cpp | |
| parent | a1607f802ae0a42ffafd2c37d76779873264d371 (diff) | |
Cleanup global memory allocations on shutdown. (#4731)
Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-api.cpp')
| -rw-r--r-- | source/slang/slang-api.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/slang/slang-api.cpp b/source/slang/slang-api.cpp index c4f668fb2..412cec0d4 100644 --- a/source/slang/slang-api.cpp +++ b/source/slang/slang-api.cpp @@ -1,9 +1,10 @@ // slang-api.cpp #include "slang-compiler.h" - #include "slang-repro.h" - +#include "slang-capability.h" +#include "../core/slang-rtti-info.h" +#include "../core/slang-performance-profiler.h" #include "../core/slang-shared-library.h" #include "../slang-record-replay/record/slang-global-session.h" #include "../slang-record-replay/util/record-utility.h" @@ -139,6 +140,14 @@ SLANG_API SlangResult slang_createGlobalSession( return SLANG_OK; } +SLANG_API void slang_shutdown() +{ + Slang::PerformanceProfiler::getProfiler()->dispose(); + Slang::SPIRVCoreGrammarInfo::freeEmbeddedGrammerInfo(); + Slang::RttiInfo::deallocateAll(); + Slang::freeCapabilityDefs(); +} + SLANG_API SlangResult slang_createGlobalSessionWithoutStdLib( SlangInt apiVersion, slang::IGlobalSession** outGlobalSession) |
