forked from Archive/PX4-Autopilot
vtol_att_control: initialise pointers and free memory
Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
parent
7a698952fb
commit
92a5db92a2
|
@ -177,6 +177,11 @@ VtolAttitudeControl::~VtolAttitudeControl()
|
|||
} while (_control_task != -1);
|
||||
}
|
||||
|
||||
// free memory used by instances of base class VtolType
|
||||
if (_vtol_type != nullptr) {
|
||||
delete _vtol_type;
|
||||
}
|
||||
|
||||
VTOL_att_control::g_control = nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -218,10 +218,10 @@ private:
|
|||
int _transition_command;
|
||||
bool _abort_front_transition;
|
||||
|
||||
VtolType *_vtol_type; // base class for different vtol types
|
||||
Tiltrotor *_tiltrotor; // tailsitter vtol type
|
||||
Tailsitter *_tailsitter; // tiltrotor vtol type
|
||||
Standard *_standard; // standard vtol type
|
||||
VtolType *_vtol_type = nullptr; // base class for different vtol types
|
||||
Tiltrotor *_tiltrotor = nullptr; // tailsitter vtol type
|
||||
Tailsitter *_tailsitter = nullptr; // tiltrotor vtol type
|
||||
Standard *_standard = nullptr; // standard vtol type
|
||||
|
||||
//*****************Member functions***********************************************************************
|
||||
|
||||
|
|
Loading…
Reference in New Issue