diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2022-07-18 15:44:29 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-18 15:44:29 -0400 |
| commit | 2e4b5770fa7e6dbf56845382706b33a22d6a025b (patch) | |
| tree | e58bcb7c446fcbffc8e1dd725636dbd737d946fc /source/core/slang-shared-library.cpp | |
| parent | da8f050f9865635e5778589e1e3883b614d73266 (diff) | |
Atomic ref counting for ISlangSharedLibrary (#2332)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Make ISlangSharedLibrary atomic ref counted.
Update docs to say most COM interfaces are *not* atomic ref counted.
* Upgrade slang-llvm to use version that atomic ref counts ISlangSharedLibrary.
* Fix some typos in docs.
* Fix ref count typo.
* Fix missing 'override'
Diffstat (limited to 'source/core/slang-shared-library.cpp')
| -rw-r--r-- | source/core/slang-shared-library.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/core/slang-shared-library.cpp b/source/core/slang-shared-library.cpp index 1513b420f..f31c7d689 100644 --- a/source/core/slang-shared-library.cpp +++ b/source/core/slang-shared-library.cpp @@ -78,6 +78,8 @@ TemporarySharedLibrary::~TemporarySharedLibrary() SLANG_NO_THROW SlangResult SLANG_MCALL DefaultSharedLibrary::queryInterface(SlangUUID const& uuid, void** outObject) { + // Mechanism to cast to underlying type. + // NOTE! Purposefully does not ref count if (uuid == DefaultSharedLibrary::getTypeGuid()) { *outObject = this; @@ -86,7 +88,7 @@ SLANG_NO_THROW SlangResult SLANG_MCALL DefaultSharedLibrary::queryInterface(Slan if (uuid == ISlangUnknown::getTypeGuid() || uuid == ISlangSharedLibrary::getTypeGuid()) { - addReference(); + ++m_refCount; *outObject = static_cast<ISlangSharedLibrary*>(this); return SLANG_OK; } @@ -106,7 +108,6 @@ void* DefaultSharedLibrary::findSymbolAddressByName(char const* name) return SharedLibrary::findSymbolAddressByName(m_sharedLibraryHandle, name); } - String SharedLibraryUtils::getSharedLibraryFileName(void* symbolInLib) { #if defined(_WIN32) |
