MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / removePluginMemoryPointer

Method removePluginMemoryPointer

Engine/EffectInstance.cpp:3238–3260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3236}
3237
3238void
3239EffectInstance::removePluginMemoryPointer(const PluginMemory* mem)
3240{
3241 std::list<PluginMemoryPtr> safeCopy;
3242
3243 {
3244 QMutexLocker l(&_imp->pluginMemoryChunksMutex);
3245 // make a copy of the list so that elements don't get deleted while the mutex is held
3246
3247 for (std::list<PluginMemoryWPtr>::iterator it = _imp->pluginMemoryChunks.begin(); it != _imp->pluginMemoryChunks.end(); ++it) {
3248 PluginMemoryPtr p = it->lock();
3249 if (!p) {
3250 continue;
3251 }
3252 safeCopy.push_back(p);
3253 if (p.get() == mem) {
3254 _imp->pluginMemoryChunks.erase(it);
3255
3256 return;
3257 }
3258 }
3259 }
3260}
3261
3262void
3263EffectInstance::registerPluginMemory(size_t nBytes)

Callers 1

~PluginMemoryMethod · 0.80

Calls 6

beginMethod · 0.45
endMethod · 0.45
lockMethod · 0.45
push_backMethod · 0.45
getMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected