Commit 8411ba0b authored by Don Gagne's avatar Don Gagne

Correct thread destruction

parent 4423a07e
......@@ -579,7 +579,11 @@ APMCompassCal::APMCompassCal(void)
APMCompassCal::~APMCompassCal()
{
if (_calWorkerThread) {
_calWorkerThread->terminate();
// deleteLater so it happens on correct thread
_calWorkerThread->deleteLater();
}
}
void APMCompassCal::setVehicle(Vehicle* vehicle)
......@@ -601,7 +605,7 @@ void APMCompassCal::startCalibration(void)
// Simulate a start message
_emitVehicleTextMessage("[cal] calibration started: mag");
_calWorkerThread = new CalWorkerThread(_vehicle, this);
_calWorkerThread = new CalWorkerThread(_vehicle);
connect(_calWorkerThread, &CalWorkerThread::vehicleTextMessage, this, &APMCompassCal::vehicleTextMessage);
// Clear the offset parameters so we get raw data
......
......@@ -461,6 +461,8 @@ QGCView {
property real indicatorWidth: (width / 3) - (spacing * 2)
property real indicatorHeight: (height / 2) - spacing
Component.onCompleted: console.log("indicatorWidth", indicatorWidth, "indicatorHeight", indicatorHeight)
VehicleRotationCal {
width: parent.indicatorWidth
height: parent.indicatorHeight
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment