diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-06-03 10:53:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-03 10:53:05 -0700 |
| commit | 446cf08b06eee9907e2eaf9df9dc01bc895904c8 (patch) | |
| tree | dd46b70ccf5d3d72fdd9dddecffd00376b48d47f | |
| parent | b06e94b87a115c5979c728ce13ddf34b80285a9f (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.cpp | 2 |
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) { |
