Fix a ref-count loop in Paticles manager

This commit is contained in:
James Turner 2021-07-29 15:21:39 +01:00 committed by Automatic Release Builder
parent 631fa62495
commit b79f03c96c
2 changed files with 9 additions and 1 deletions

View File

@ -512,6 +512,14 @@ void Particles::setupStaticColorComponent(float r1, float g1, float b1, float a1
staticColorComponents[7] = a2;
}
ParticlesGlobalManager::~ParticlesGlobalManager()
{
// break a ref-counting cycle
if (d->_commonRoot) {
d->_commonRoot->removeUpdateCallback(d.get());
}
}
void ParticlesGlobalManager::setWindVector(const osg::Vec3& wind)
{
std::lock_guard<std::mutex> g(d->_lock);

View File

@ -150,7 +150,7 @@ protected:
class ParticlesGlobalManager
{
public:
~ParticlesGlobalManager() = default;
~ParticlesGlobalManager();
static ParticlesGlobalManager* instance();
static void clear();