mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-22 08:04:49 -05:00
Instantiate QNetworkAccessManager to avoid crash on reverse API usage
This commit is contained in:
parent
2c32224977
commit
d507f49626
@ -54,10 +54,14 @@ AFC::AFC(WebAPIAdapterInterface *webAPIAdapterInterface) :
|
||||
m_worker = new AFCWorker(webAPIAdapterInterface);
|
||||
m_state = StIdle;
|
||||
m_errorMessage = "AFC error";
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
|
||||
AFC::~AFC()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
if (m_worker->isRunning()) {
|
||||
stop();
|
||||
}
|
||||
|
@ -50,10 +50,14 @@ APRS::APRS(WebAPIAdapterInterface *webAPIAdapterInterface) :
|
||||
m_errorMessage = "APRS error";
|
||||
connect(&m_updatePipesTimer, SIGNAL(timeout()), this, SLOT(updatePipes()));
|
||||
m_updatePipesTimer.start(1000);
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
|
||||
APRS::~APRS()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
if (m_worker->isRunning()) {
|
||||
stop();
|
||||
}
|
||||
|
@ -56,10 +56,14 @@ DemodAnalyzer::DemodAnalyzer(WebAPIAdapterInterface *webAPIAdapterInterface) :
|
||||
m_worker = new DemodAnalyzerWorker();
|
||||
m_state = StIdle;
|
||||
m_errorMessage = "DemodAnalyzer error";
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
|
||||
DemodAnalyzer::~DemodAnalyzer()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
if (m_worker->isRunning()) {
|
||||
stop();
|
||||
}
|
||||
|
@ -56,10 +56,14 @@ GS232Controller::GS232Controller(WebAPIAdapterInterface *webAPIAdapterInterface)
|
||||
m_selectedPipe = nullptr;
|
||||
connect(&m_updatePipesTimer, SIGNAL(timeout()), this, SLOT(updatePipes()));
|
||||
m_updatePipesTimer.start(1000);
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
|
||||
GS232Controller::~GS232Controller()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
if (m_worker->isRunning()) {
|
||||
stop();
|
||||
}
|
||||
|
@ -49,10 +49,14 @@ Map::Map(WebAPIAdapterInterface *webAPIAdapterInterface) :
|
||||
m_errorMessage = "Map error";
|
||||
connect(&m_updatePipesTimer, SIGNAL(timeout()), this, SLOT(updatePipes()));
|
||||
m_updatePipesTimer.start(1000);
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
|
||||
Map::~Map()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
}
|
||||
|
||||
bool Map::handleMessage(const Message& cmd)
|
||||
|
@ -45,10 +45,14 @@ RigCtlServer::RigCtlServer(WebAPIAdapterInterface *webAPIAdapterInterface) :
|
||||
m_worker = new RigCtlServerWorker(webAPIAdapterInterface);
|
||||
m_state = StIdle;
|
||||
m_errorMessage = "RigCtlServer error";
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
|
||||
RigCtlServer::~RigCtlServer()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
if (m_worker->isRunning()) {
|
||||
stop();
|
||||
}
|
||||
|
@ -46,10 +46,14 @@ SimplePTT::SimplePTT(WebAPIAdapterInterface *webAPIAdapterInterface) :
|
||||
m_worker = new SimplePTTWorker(webAPIAdapterInterface);
|
||||
m_state = StIdle;
|
||||
m_errorMessage = "SimplePTT error";
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
|
||||
SimplePTT::~SimplePTT()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
if (m_worker->isRunning()) {
|
||||
stop();
|
||||
}
|
||||
|
@ -45,10 +45,14 @@ StarTracker::StarTracker(WebAPIAdapterInterface *webAPIAdapterInterface) :
|
||||
m_worker = new StarTrackerWorker(this, webAPIAdapterInterface);
|
||||
m_state = StIdle;
|
||||
m_errorMessage = "StarTracker error";
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
|
||||
StarTracker::~StarTracker()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
if (m_worker->isRunning()) {
|
||||
stop();
|
||||
}
|
||||
|
@ -53,10 +53,14 @@ VORLocalizer::VORLocalizer(WebAPIAdapterInterface *webAPIAdapterInterface) :
|
||||
m_worker = new VorLocalizerWorker(webAPIAdapterInterface);
|
||||
m_state = StIdle;
|
||||
m_errorMessage = "VORLocalizer error";
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
|
||||
VORLocalizer::~VORLocalizer()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
if (m_worker->isRunning()) {
|
||||
stop();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user