Fixes a segfault on startup. The previous code assumed that ModelRegistry::instance would be initialized before being used by other static initializers.
However, static initialization order is undefined.
Plus, at least unter C++11 and according to 6.7[stmt.decl] p.4, this initialization of get():inst is thread-safe.
Fixes a segfault on startup. The previous code assumed that ModelRegistry::instance would be initialized before being used by other static initializers.
However, static initialization order is undefined. Plus, at least unter C++11 and according to 6.7[stmt.decl] p.4, this initialization of get():inst is thread-safe.
(this might be relevant to https://github.com/OpenHantek/openhantek/issues/182)