From 61a6d18c4870eb55b804d36a30608a34c55e801d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 20 Feb 2018 16:34:59 -0500 Subject: make CompileRequest retain specailized IR module. This is to workaround with the issue that the Types returned in ProgramLayout may reference to IRWitnessTables via GlobalGenericParamSubstitution. --- source/slang/slang.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index b65ec5615..42e412438 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -123,7 +123,13 @@ CompileRequest::CompileRequest(Session* session) } CompileRequest::~CompileRequest() -{} +{ + // delete things that may reference IR objects first + targets = decltype(targets)(); + translationUnits = decltype(translationUnits)(); + entryPoints = decltype(entryPoints)(); + types = decltype(types)(); +} RefPtr CompileRequest::parseTypeString(TranslationUnitRequest * translationUnit, String typeStr, RefPtr scope) -- cgit v1.2.3