summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 0f5d8e17a..b65ec5615 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -734,6 +734,19 @@ void Session::addBuiltinSource(
loadedModuleCode.Add(syntax);
}
+Session::~Session()
+{
+ // free all built-in types first
+ errorType = nullptr;
+ initializerListType = nullptr;
+ overloadedType = nullptr;
+ irBasicBlockType = nullptr;
+
+ builtinTypes = decltype(builtinTypes)();
+ // destroy modules next
+ loadedModuleCode = decltype(loadedModuleCode)();
+}
+
}
// implementation of C interface