summaryrefslogtreecommitdiff
path: root/source/compiler-core
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler-core')
-rw-r--r--source/compiler-core/slang-downstream-compiler.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/compiler-core/slang-downstream-compiler.cpp b/source/compiler-core/slang-downstream-compiler.cpp
index 85726557e..2e30c23bc 100644
--- a/source/compiler-core/slang-downstream-compiler.cpp
+++ b/source/compiler-core/slang-downstream-compiler.cpp
@@ -360,11 +360,16 @@ SlangResult CommandLineDownstreamCompileResult::getHostCallableSharedLibrary(Com
{
return SLANG_FAIL;
}
- // The shared library needs to keep temp files in scope
- RefPtr<TemporarySharedLibrary> sharedLib(new TemporarySharedLibrary(handle, m_moduleFilePath));
- sharedLib->m_temporaryFileSet = m_temporaryFiles;
+
+ {
+ // The shared library needs to keep temp files in scope
+ auto temporarySharedLibrary = new TemporarySharedLibrary(handle, m_moduleFilePath);
+ // Make sure it gets a ref count
+ m_hostCallableSharedLibrary = temporarySharedLibrary;
+ // Set any additional info on the non COM pointer
+ temporarySharedLibrary->m_temporaryFileSet = m_temporaryFiles;
+ }
- m_hostCallableSharedLibrary = sharedLib;
outLibrary = m_hostCallableSharedLibrary;
return SLANG_OK;
}