You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User objects defined in C++ global space might cause the system to crash, by dereferencing null pointers.
Background
The global object ApplicationContext is defined in C++ global space. This means it is initialized by the language runtime. Especially Arduino SDK needs to declare user interface objects in global space, that depends on an initialized ApplicationContext. However, C++ (or C) runtime does not guarantee any order of of object initialization.
Solution
Currently the singleton ApplicationContext is obtained by the static member variable of the context interface:
mono::IApplicationContext::Instance
Here Instance is the stat9c member of the interface. The member is null until the global app. context is constructed by the C++ runtime.
We should reference the app. context by using a function - not a member variable. Instead this function will create and return, or later just return the global ApplicationContext. Then, to get a reference to the context you could do this:
mono::IApplicationContext::get()
The text was updated successfully, but these errors were encountered:
This is an issue that was raised in #20
Problem
User objects defined in C++ global space might cause the system to crash, by dereferencing null pointers.
Background
The global object ApplicationContext is defined in C++ global space. This means it is initialized by the language runtime. Especially Arduino SDK needs to declare user interface objects in global space, that depends on an initialized ApplicationContext. However, C++ (or C) runtime does not guarantee any order of of object initialization.
Solution
Currently the singleton ApplicationContext is obtained by the static member variable of the context interface:
Here
Instance
is the stat9c member of the interface. The member is null until the global app. context is constructed by the C++ runtime.We should reference the app. context by using a function - not a member variable. Instead this function will create and return, or later just return the global ApplicationContext. Then, to get a reference to the context you could do this:
The text was updated successfully, but these errors were encountered: