diff --git a/include/hyperion/BGEffectHandler.h b/include/hyperion/BGEffectHandler.h index 96de909b..f3ee8087 100644 --- a/include/hyperion/BGEffectHandler.h +++ b/include/hyperion/BGEffectHandler.h @@ -43,6 +43,16 @@ public: handleSettingsUpdate(settings::BGEFFECT, _hyperion->getSetting(settings::BGEFFECT)); } + /// + /// @brief Disconnect from connected signals + /// Disconnect should be done before other priorities invoke methods during shutdown + /// + void disconnect() + { + QObject::disconnect(_prioMuxer, &PriorityMuxer::prioritiesChanged, nullptr, nullptr); + QObject::disconnect(_hyperion, nullptr, nullptr, nullptr); + } + /// /// @brief Check, if background effect processing is enabled. /// @return True, background effect processing is enabled. diff --git a/libsrc/hyperion/Hyperion.cpp b/libsrc/hyperion/Hyperion.cpp index 539b823c..2a2b50d6 100644 --- a/libsrc/hyperion/Hyperion.cpp +++ b/libsrc/hyperion/Hyperion.cpp @@ -200,13 +200,16 @@ void Hyperion::stop() void Hyperion::freeObjects() { - //delete Background effect first that it does not kick in when other priorities are stopped - delete _BGEffectHandler; + //Disconnect Background effect first that it does not kick in when other priorities are stopped + _BGEffectHandler->disconnect(); //Remove all priorities to switch off all leds clear(-1,true); // delete components on exit of hyperion core + + delete _BGEffectHandler; + #if defined(ENABLE_BOBLIGHT_SERVER) delete _boblightServer; #endif