AP_Logger: add comments about message_writer being leaked

These are really "shouldn't happen", and only happen at startup, so
impact of the memory leak is quite limited.

Fixing this requires putting in a virtual destructor on the
MessageWriter class - this and the calls add up to several hundred bytes
of flash.
This commit is contained in:
Peter Barker 2020-03-12 08:24:13 +11:00 committed by Peter Barker
parent bb0920d56a
commit 8679e95fca

View File

@ -137,6 +137,8 @@ void AP_Logger::Init(const struct LogStructure *structures, uint8_t num_types)
}
if (backends[_next_backend] == nullptr) {
hal.console->printf("Unable to open AP_Logger_File");
// note that message_writer is leaked here; costs several
// hundred bytes to fix for marginal utility
} else {
_next_backend++;
}
@ -156,6 +158,8 @@ void AP_Logger::Init(const struct LogStructure *structures, uint8_t num_types)
}
if (backends[_next_backend] == nullptr) {
hal.console->printf("Unable to open AP_Logger_DataFlash");
// note that message_writer is leaked here; costs several
// hundred bytes to fix for marginal utility
} else {
_next_backend++;
}
@ -175,6 +179,8 @@ void AP_Logger::Init(const struct LogStructure *structures, uint8_t num_types)
}
if (backends[_next_backend] == nullptr) {
hal.console->printf("Unable to open AP_Logger_SITL");
// note that message_writer is leaked here; costs several
// hundred bytes to fix for marginal utility
} else {
_next_backend++;
}
@ -195,6 +201,8 @@ void AP_Logger::Init(const struct LogStructure *structures, uint8_t num_types)
}
if (backends[_next_backend] == nullptr) {
hal.console->printf("Unable to open AP_Logger_MAVLink");
// note that message_writer is leaked here; costs several
// hundred bytes to fix for marginal utility
} else {
_next_backend++;
}