Fix a use-after-free found by ASan.
This commit is contained in:
parent
51173f32ff
commit
2295e82a0f
2 changed files with 10 additions and 0 deletions
|
@ -267,6 +267,7 @@ void
|
|||
GPS::unbind()
|
||||
{
|
||||
_tiedProperties.Untie();
|
||||
_gpsNode.clear();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -366,6 +367,14 @@ GPS::update (double delta_time_sec)
|
|||
_lastPosValid = !(_last_pos == SGGeod());
|
||||
}
|
||||
|
||||
void GPS::shutdown()
|
||||
{
|
||||
if (_route) {
|
||||
_route->removeDelegate(this);
|
||||
_route = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void GPS::routeManagerFlightPlanChanged(SGPropertyNode*)
|
||||
{
|
||||
if (_route) {
|
||||
|
|
|
@ -70,6 +70,7 @@ public:
|
|||
void bind() override;
|
||||
void unbind() override;
|
||||
void update (double delta_time_sec) override;
|
||||
void shutdown() override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* staticSubsystemClassId() { return "gps"; }
|
||||
|
|
Loading…
Add table
Reference in a new issue