1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

Do not create objects if there is no message queue to send to

Prevents memory leaks.
This commit is contained in:
Daniele Forsi 2024-05-04 17:46:12 +02:00
parent 461a79439b
commit 3c0541d87a

View File

@ -172,16 +172,16 @@ bool StarTracker::handleMessage(const Message& cmd)
} }
else if (MainCore::MsgStarTrackerDisplaySettings::match(cmd)) else if (MainCore::MsgStarTrackerDisplaySettings::match(cmd))
{ {
MainCore::MsgStarTrackerDisplaySettings& settings = (MainCore::MsgStarTrackerDisplaySettings&) cmd;
if (m_guiMessageQueue) { if (m_guiMessageQueue) {
MainCore::MsgStarTrackerDisplaySettings& settings = (MainCore::MsgStarTrackerDisplaySettings&) cmd;
m_guiMessageQueue->push(new MainCore::MsgStarTrackerDisplaySettings(settings)); m_guiMessageQueue->push(new MainCore::MsgStarTrackerDisplaySettings(settings));
} }
return true; return true;
} }
else if (MainCore::MsgStarTrackerDisplayLoSSettings::match(cmd)) else if (MainCore::MsgStarTrackerDisplayLoSSettings::match(cmd))
{ {
MainCore::MsgStarTrackerDisplayLoSSettings& settings = (MainCore::MsgStarTrackerDisplayLoSSettings&) cmd;
if (m_guiMessageQueue) { if (m_guiMessageQueue) {
MainCore::MsgStarTrackerDisplayLoSSettings& settings = (MainCore::MsgStarTrackerDisplayLoSSettings&) cmd;
m_guiMessageQueue->push(new MainCore::MsgStarTrackerDisplayLoSSettings(settings)); m_guiMessageQueue->push(new MainCore::MsgStarTrackerDisplayLoSSettings(settings));
} }
return true; return true;