|
@@ -48,6 +48,7 @@ class DLL_LINKAGE SettingsStorage
|
|
public:
|
|
public:
|
|
// Initialize config structure
|
|
// Initialize config structure
|
|
SettingsStorage();
|
|
SettingsStorage();
|
|
|
|
+ ~SettingsStorage();
|
|
void init(const std::string & dataFilename, const std::string & schema);
|
|
void init(const std::string & dataFilename, const std::string & schema);
|
|
|
|
|
|
// Get write access to config node at path
|
|
// Get write access to config node at path
|
|
@@ -73,11 +74,15 @@ class DLL_LINKAGE SettingsListener
|
|
// Callback
|
|
// Callback
|
|
std::function<void(const JsonNode&)> callback;
|
|
std::function<void(const JsonNode&)> callback;
|
|
|
|
|
|
|
|
+ // hack for crash due to static destruction order
|
|
|
|
+ bool wasTerminated = false;
|
|
|
|
+
|
|
SettingsListener(SettingsStorage & _parent, std::vector<std::string> _path);
|
|
SettingsListener(SettingsStorage & _parent, std::vector<std::string> _path);
|
|
|
|
|
|
// Executes callback if changedpath begins with path
|
|
// Executes callback if changedpath begins with path
|
|
void nodeInvalidated(const std::vector<std::string> & changedPath);
|
|
void nodeInvalidated(const std::vector<std::string> & changedPath);
|
|
|
|
|
|
|
|
+ void terminate();
|
|
public:
|
|
public:
|
|
SettingsListener(const SettingsListener &sl);
|
|
SettingsListener(const SettingsListener &sl);
|
|
~SettingsListener();
|
|
~SettingsListener();
|