Is this data model safe
In order to implement my ui component more independently, I design it this way.
// subclass of container
MyComponent::MyComponent()
{
// init some ui
// ...
Application::getInstance()->registerTimerWidget(this);
}
MyComponent::~MyComponent()
{
Application::getInstance()->unregisterTimerWidget(this);
}
void MyComponent::handleTickEvent()
{
if(backend_data_dirty){
backend_data_dirty = 0;
// update some ui
}
}
I have designed some components this way, and can run smoothly. So I avoided use touchgfx's model and presenter completely.
But recently, when more and more ui put together, program always crashed at FrontendApplication.hpp
virtual void handleTickEvent()
{
model.tick();
FrontendApplicationBase::handleTickEvent();
}
As no source code suplied, I have no way to debug it.
