mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 04:51:36 +08:00
Add perf_free() calls orb_unsubscribe and remove delete _instance in the Simulator class destructor.
This commit is contained in:
@@ -255,9 +255,18 @@ private:
|
|||||||
|
|
||||||
~Simulator()
|
~Simulator()
|
||||||
{
|
{
|
||||||
if (_instance != nullptr) {
|
// Unsubscribe from uORB topics.
|
||||||
delete _instance;
|
orb_unsubscribe(_param_sub);
|
||||||
}
|
|
||||||
|
// free perf counters
|
||||||
|
perf_free(_perf_accel);
|
||||||
|
perf_free(_perf_airspeed);
|
||||||
|
perf_free(_perf_baro);
|
||||||
|
perf_free(_perf_gps);
|
||||||
|
perf_free(_perf_mag);
|
||||||
|
perf_free(_perf_mpu);
|
||||||
|
perf_free(_perf_sim_delay);
|
||||||
|
perf_free(_perf_sim_interval);
|
||||||
|
|
||||||
_instance = NULL;
|
_instance = NULL;
|
||||||
}
|
}
|
||||||
@@ -358,8 +367,8 @@ private:
|
|||||||
|
|
||||||
// uORB data containers
|
// uORB data containers
|
||||||
input_rc_s _rc_input {};
|
input_rc_s _rc_input {};
|
||||||
vehicle_attitude_s _attitude {};
|
|
||||||
manual_control_setpoint_s _manual {};
|
manual_control_setpoint_s _manual {};
|
||||||
|
vehicle_attitude_s _attitude {};
|
||||||
vehicle_status_s _vehicle_status {};
|
vehicle_status_s _vehicle_status {};
|
||||||
|
|
||||||
DEFINE_PARAMETERS(
|
DEFINE_PARAMETERS(
|
||||||
|
|||||||
Reference in New Issue
Block a user