summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2025-06-03 10:53:05 -0700
committerGitHub <noreply@github.com>2025-06-03 10:53:05 -0700
commit446cf08b06eee9907e2eaf9df9dc01bc895904c8 (patch)
treedd46b70ccf5d3d72fdd9dddecffd00376b48d47f
parentb06e94b87a115c5979c728ce13ddf34b80285a9f (diff)
Fix the memory leak (#7290)
When we return a raw point to a module, we should decrement the reference count. The module is owned by its session so it should be valid as long as the session is valid.
-rw-r--r--source/slang/slang.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index bda847815..9aa8c56a7 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -1601,7 +1601,7 @@ slang::IModule* Linkage::loadModuleFromBlob(
RefPtr<Module> module =
loadModuleImpl(name, pathInfo, source, SourceLoc(), &sink, nullptr, blobType);
sink.getBlobIfNeeded(outDiagnostics);
- return asExternal(module.detach());
+ return asExternal(module.get());
}
catch (const AbortCompilationException& e)
{