Permalink
Browse files

engine: request faders disposal asynchronously

The sync way interfere with Universes business and can cause crashes
  • Loading branch information...
mcallegari committed Dec 7, 2018
1 parent cbdd499 commit 93cda8751df167d344673f372914d3950f3bc577
Showing with 9 additions and 9 deletions.
  1. +1 −1 engine/src/efx.cpp
  2. +2 −3 engine/src/function.cpp
  3. +1 −1 engine/src/function.h
  4. +2 −1 engine/src/rgbmatrix.cpp
  5. +2 −2 engine/src/scene.cpp
  6. +1 −1 engine/src/script.cpp
@@ -1101,7 +1101,7 @@ void EFX::postRun(MasterTimer *timer, QList<Universe *> universes)
ef->reset();
}

dismissAllFaders(universes);
dismissAllFaders();

Function::postRun(timer, universes);
}
@@ -1030,15 +1030,14 @@ void Function::postRun(MasterTimer* timer, QList<Universe *> universes)
emit stopped(m_id);
}

void Function::dismissAllFaders(QList<Universe *> universes)
void Function::dismissAllFaders()
{
QMapIterator <quint32, GenericFader*> it(m_fadersMap);
while (it.hasNext() == true)
{
it.next();
quint32 universe = it.key();
GenericFader *fader = it.value();
universes[universe]->dismissFader(fader);
fader->requestDelete();
}

m_fadersMap.clear();
@@ -697,7 +697,7 @@ public slots:
/** Helper method to dismiss all the faders previously added to
* m_fadersMap. This is usually called on Function postRun when
* no fade out is requested */
virtual void dismissAllFaders(QList<Universe *> universes);
virtual void dismissAllFaders();

signals:
/**
@@ -619,7 +619,7 @@ void RGBMatrix::postRun(MasterTimer *timer, QList<Universe *> universes)
* when done */
if (fadeout == 0)
{
dismissAllFaders(universes);
dismissAllFaders();
}
else
{
@@ -667,6 +667,7 @@ FadeChannel *RGBMatrix::getFader(QList<Universe *> universes, quint32 universeID
fader = universes[universeID]->requestFader();
fader->adjustIntensity(getAttributeValue(Intensity));
fader->setBlendMode(blendMode());
fader->setName(name());
m_fadersMap[universeID] = fader;
}

@@ -611,7 +611,7 @@ void Scene::writeDMX(MasterTimer *timer, QList<Universe *> ua)
}
else
{
dismissAllFaders(ua);
dismissAllFaders();
timer->unregisterDMXSource(this);
}
}
@@ -721,7 +721,7 @@ void Scene::postRun(MasterTimer* timer, QList<Universe *> ua)
* when done */
if (fadeout == 0)
{
dismissAllFaders(ua);
dismissAllFaders();
}
else
{
@@ -367,7 +367,7 @@ void Script::postRun(MasterTimer *timer, QList<Universe *> universes)

m_startedFunctions.clear();

dismissAllFaders(universes);
dismissAllFaders();

Function::postRun(timer, universes);
}

0 comments on commit 93cda87

Please sign in to comment.