MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / releasePlugin

Method releasePlugin

Source/Falcor/Core/Plugin.cpp:93–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93bool PluginManager::releasePlugin(const std::filesystem::path& path)
94{
95 std::lock_guard<std::mutex> librariesLock(mLibrariesMutex);
96
97 auto libraryIt = mLibraries.find(path);
98 if (libraryIt == mLibraries.end())
99 {
100 logWarning("Failed to release plugin library {}. The library isn't loaded.", path);
101 return false;
102 }
103
104 // Get library handle.
105 SharedLibraryHandle library = libraryIt->second;
106
107 // Delete all the classes that were owned by the library.
108 {
109 std::lock_guard<std::mutex> classDescsLock(mClassDescsMutex);
110 for (auto it = mClassDescs.begin(); it != mClassDescs.end();)
111 {
112 if (it->second->library == library)
113 it = mClassDescs.erase(it);
114 else
115 ++it;
116 }
117 }
118
119 releaseSharedLibrary(library);
120 mLibraries.erase(libraryIt);
121
122 return true;
123}
124
125void PluginManager::loadAllPlugins()
126{

Callers

nothing calls this directly

Calls 5

eraseMethod · 0.80
logWarningFunction · 0.50
releaseSharedLibraryFunction · 0.50
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected