mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
send close signal only on restart to avoid problems while destructiong on normal exit (#376)
This commit is contained in:
parent
3aa2573b88
commit
cde5a4dff1
@ -70,7 +70,7 @@ public:
|
||||
///
|
||||
/// free all alocated objects, should be called only from constructor or before restarting hyperion
|
||||
///
|
||||
void freeObjects();
|
||||
void freeObjects(bool emitCloseSignal=false);
|
||||
|
||||
static Hyperion* initInstance(const QJsonObject& qjsonConfig, const QString configFile);
|
||||
static Hyperion* getInstance();
|
||||
|
@ -447,9 +447,12 @@ Hyperion::Hyperion(const QJsonObject &qjsonConfig, const QString configFile)
|
||||
}
|
||||
|
||||
|
||||
void Hyperion::freeObjects()
|
||||
void Hyperion::freeObjects(bool emitCloseSignal)
|
||||
{
|
||||
emit closing();
|
||||
if (emitCloseSignal)
|
||||
{
|
||||
emit closing();
|
||||
}
|
||||
|
||||
// switch off all leds
|
||||
clearall();
|
||||
@ -464,7 +467,7 @@ void Hyperion::freeObjects()
|
||||
|
||||
Hyperion::~Hyperion()
|
||||
{
|
||||
freeObjects();
|
||||
freeObjects(false);
|
||||
}
|
||||
|
||||
unsigned Hyperion::getLedCount() const
|
||||
|
@ -930,7 +930,7 @@ void JsonClientConnection::handleConfigCommand(const QJsonObject& message, const
|
||||
}
|
||||
else if (subcommand == "reload")
|
||||
{
|
||||
_hyperion->freeObjects();
|
||||
_hyperion->freeObjects(true);
|
||||
Process::restartHyperion();
|
||||
sendErrorReply("failed to restart hyperion", full_command, tan);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user