Browse Source

Correct thread destruction

QGC4.4
Don Gagne 9 years ago
parent
commit
8411ba0b74
  1. 8
      src/AutoPilotPlugins/APM/APMCompassCal.cc
  2. 2
      src/AutoPilotPlugins/PX4/SensorsComponent.qml

8
src/AutoPilotPlugins/APM/APMCompassCal.cc

@ -579,7 +579,11 @@ APMCompassCal::APMCompassCal(void) @@ -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) @@ -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

2
src/AutoPilotPlugins/PX4/SensorsComponent.qml

@ -461,6 +461,8 @@ QGCView { @@ -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

Loading…
Cancel
Save