Fix a ref-count loop in Paticles manager
This commit is contained in:
parent
67bb39083c
commit
d6e452ea08
@ -516,6 +516,14 @@ void Particles::setupStaticColorComponent(float r1, float g1, float b1, float a1
|
|||||||
staticColorComponents[7] = a2;
|
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)
|
void ParticlesGlobalManager::setWindVector(const osg::Vec3& wind)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> g(d->_lock);
|
std::lock_guard<std::mutex> g(d->_lock);
|
||||||
|
@ -150,7 +150,7 @@ protected:
|
|||||||
class ParticlesGlobalManager
|
class ParticlesGlobalManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
~ParticlesGlobalManager() = default;
|
~ParticlesGlobalManager();
|
||||||
|
|
||||||
static ParticlesGlobalManager* instance();
|
static ParticlesGlobalManager* instance();
|
||||||
static void clear();
|
static void clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user