mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-16 05:11:49 -05:00
Do not create a Message if there is no worker to send to
Prevents memory leaks.
This commit is contained in:
parent
8829df3c3b
commit
461a79439b
@ -189,10 +189,10 @@ void PERTester::applySettings(const PERTesterSettings& settings, const QList<QSt
|
||||
{
|
||||
qDebug() << "PERTester::applySettings:" << settings.getDebugString(settingsKeys, force) << " force: " << force;
|
||||
|
||||
if (m_worker) {
|
||||
PERTesterWorker::MsgConfigurePERTesterWorker *msg = PERTesterWorker::MsgConfigurePERTesterWorker::create(
|
||||
settings, settingsKeys, force
|
||||
);
|
||||
if (m_worker) {
|
||||
m_worker->getInputMessageQueue()->push(msg);
|
||||
}
|
||||
|
||||
|
@ -208,11 +208,10 @@ void SatelliteTracker::applySettings(const SatelliteTrackerSettings& settings, c
|
||||
tlesChanged = true;
|
||||
}
|
||||
|
||||
if (m_worker) {
|
||||
SatelliteTrackerWorker::MsgConfigureSatelliteTrackerWorker *msg = SatelliteTrackerWorker::MsgConfigureSatelliteTrackerWorker::create(
|
||||
settings, settingsKeys, force
|
||||
);
|
||||
|
||||
if (m_worker) {
|
||||
m_worker->getInputMessageQueue()->push(msg);
|
||||
}
|
||||
|
||||
|
@ -163,9 +163,9 @@ bool StarTracker::handleMessage(const Message& cmd)
|
||||
}
|
||||
else if (MsgSetSolarFlux::match(cmd))
|
||||
{
|
||||
if (m_worker) {
|
||||
MsgSetSolarFlux& msg = (MsgSetSolarFlux&) cmd;
|
||||
m_solarFlux = msg.getFlux();
|
||||
if (m_worker) {
|
||||
m_worker->getInputMessageQueue()->push(new MsgSetSolarFlux(msg));
|
||||
}
|
||||
return true;
|
||||
@ -246,10 +246,10 @@ void StarTracker::applySettings(const StarTrackerSettings& settings, const QList
|
||||
}
|
||||
}
|
||||
|
||||
if (m_worker) {
|
||||
StarTrackerWorker::MsgConfigureStarTrackerWorker *msg = StarTrackerWorker::MsgConfigureStarTrackerWorker::create(
|
||||
settings, settingsKeys, force
|
||||
);
|
||||
if (m_worker) {
|
||||
m_worker->getInputMessageQueue()->push(msg);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user