AP_SerialManager: removed create() method for objects

See discussion here:

  https://github.com/ArduPilot/ardupilot/issues/7331

we were getting some uninitialised variables. While it only showed up in
AP_SbusOut, it means we can't be sure it won't happen on other objects,
so safest to remove the approach

Thanks to assistance from Lucas, Peter and Francisco
This commit is contained in:
Andrew Tridgell 2017-12-13 12:06:14 +11:00
parent 580af4a69a
commit dd489a0797
1 changed files with 6 additions and 10 deletions

View File

@ -81,6 +81,12 @@
class AP_SerialManager {
public:
AP_SerialManager();
/* Do not allow copies */
AP_SerialManager(const AP_SerialManager &other) = delete;
AP_SerialManager &operator=(const AP_SerialManager&) = delete;
enum SerialProtocol {
SerialProtocol_None = -1,
SerialProtocol_Console = 0, // unused
@ -106,14 +112,6 @@ public:
return _instance;
}
static AP_SerialManager create() { return AP_SerialManager{}; }
constexpr AP_SerialManager(AP_SerialManager &&other) = default;
/* Do not allow copies */
AP_SerialManager(const AP_SerialManager &other) = delete;
AP_SerialManager &operator=(const AP_SerialManager&) = delete;
// init_console - initialise console at default baud rate
void init_console();
@ -149,8 +147,6 @@ public:
static const struct AP_Param::GroupInfo var_info[];
private:
AP_SerialManager();
static AP_SerialManager *_instance;
// array of uart info