mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 06:53:34 +08:00
Good old GDTR singleton re-implemented via static local again, because previous implementation could cause undefined behavior as GDTR could be initialized after static type registrators that use it
This commit is contained in:
@@ -64,12 +64,6 @@ private:
|
||||
mutable List srvs_;
|
||||
bool frozen_;
|
||||
|
||||
/**
|
||||
* We can't use function local static variable for singleton because of code size issues:
|
||||
* http://stackoverflow.com/questions/22985570
|
||||
*/
|
||||
static GlobalDataTypeRegistry singleton;
|
||||
|
||||
GlobalDataTypeRegistry() : frozen_(false) { }
|
||||
|
||||
List* selectList(DataTypeKind kind) const;
|
||||
|
||||
Reference in New Issue
Block a user