Stop thread if still running in destructor
Threads addressed in this commit: - Transmitter (txThread, txStats) - Capturer - EmulXcvr
This commit is contained in:
parent
cf84060277
commit
f185ceb206
@ -401,6 +401,8 @@ PcapPort::PortCapturer::PortCapturer(const char *device)
|
|||||||
|
|
||||||
PcapPort::PortCapturer::~PortCapturer()
|
PcapPort::PortCapturer::~PortCapturer()
|
||||||
{
|
{
|
||||||
|
if (isRunning())
|
||||||
|
stop();
|
||||||
capFile_.close();
|
capFile_.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -549,7 +551,8 @@ PcapPort::EmulationTransceiver::EmulationTransceiver(const char *device,
|
|||||||
|
|
||||||
PcapPort::EmulationTransceiver::~EmulationTransceiver()
|
PcapPort::EmulationTransceiver::~EmulationTransceiver()
|
||||||
{
|
{
|
||||||
stop();
|
if (isRunning())
|
||||||
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PcapPort::EmulationTransceiver::run()
|
void PcapPort::EmulationTransceiver::run()
|
||||||
@ -738,7 +741,7 @@ void PcapPort::EmulationTransceiver::stop()
|
|||||||
QThread::msleep(10);
|
QThread::msleep(10);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qWarning("Receive stop requested but is not running!");
|
qWarning("Emulation Xcvr stop requested but is not running!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,10 @@ PcapTransmitter::PcapTransmitter(
|
|||||||
|
|
||||||
PcapTransmitter::~PcapTransmitter()
|
PcapTransmitter::~PcapTransmitter()
|
||||||
{
|
{
|
||||||
|
if (txThread_.isRunning())
|
||||||
|
txThread_.stop();
|
||||||
|
if (txStats_.isRunning())
|
||||||
|
txStats_.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PcapTransmitter::setRateAccuracy(
|
bool PcapTransmitter::setRateAccuracy(
|
||||||
|
Loading…
Reference in New Issue
Block a user