mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
fix restart of hyperion. now devices closed before restart (#269)
This commit is contained in:
parent
e889996ae7
commit
37558a983f
@ -78,6 +78,10 @@ public:
|
||||
///
|
||||
~Hyperion();
|
||||
|
||||
///
|
||||
/// free all alocated objects, should be called only from constructor or before restarting hyperion
|
||||
///
|
||||
void freeObjects();
|
||||
|
||||
static Hyperion* initInstance(const Json::Value& jsonConfig, const QJsonObject& qjsonConfig, const std::string configFile);
|
||||
static Hyperion* getInstance();
|
||||
|
@ -594,7 +594,7 @@ Hyperion::Hyperion(const Json::Value &jsonConfig, const QJsonObject &qjsonConfig
|
||||
}
|
||||
|
||||
|
||||
Hyperion::~Hyperion()
|
||||
void Hyperion::freeObjects()
|
||||
{
|
||||
// switch off all leds
|
||||
clearall();
|
||||
@ -608,6 +608,11 @@ Hyperion::~Hyperion()
|
||||
delete _messageForwarder;
|
||||
}
|
||||
|
||||
Hyperion::~Hyperion()
|
||||
{
|
||||
freeObjects();
|
||||
}
|
||||
|
||||
unsigned Hyperion::getLedCount() const
|
||||
{
|
||||
return _ledString.leds().size();
|
||||
|
@ -903,6 +903,7 @@ void JsonClientConnection::handleConfigCommand(const QJsonObject& message, const
|
||||
}
|
||||
else if (subcommand == "reload")
|
||||
{
|
||||
_hyperion->freeObjects();
|
||||
Process::restartHyperion();
|
||||
sendErrorReply("failed to restart hyperion", full_command, tan);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user