summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/slang.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/slang.h b/include/slang.h
index 6fd6da7b2..849532fc8 100644
--- a/include/slang.h
+++ b/include/slang.h
@@ -5351,6 +5351,14 @@ Returns nullptr if there isn't an embedded stdlib.
*/
SLANG_API ISlangBlob* slang_getEmbeddedStdLib();
+
+/* Cleanup all global allocations used by Slang, to prevent memory leak detectors from
+ reporting them as leaks. This function should only be called after all Slang objects
+ have been released. No other Slang functions such as `createGlobalSession`
+ should be called after this function.
+ */
+SLANG_EXTERN_C SLANG_API void slang_shutdown();
+
namespace slang
{
inline SlangResult createGlobalSession(
@@ -5358,6 +5366,7 @@ namespace slang
{
return slang_createGlobalSession(SLANG_API_VERSION, outGlobalSession);
}
+ inline void shutdown() { slang_shutdown(); }
}
/** @see slang::ICompileRequest::getProgram