| 3236 | } |
| 3237 | |
| 3238 | void |
| 3239 | EffectInstance::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 | |
| 3262 | void |
| 3263 | EffectInstance::registerPluginMemory(size_t nBytes) |