mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 20:08:36 -07:00
JS: Fix widget sometimes MemCrash on exit.
This commit is contained in:
@@ -917,9 +917,8 @@ static void widget_remove_view(void* context) {
|
||||
ComponentArray_it(it, model->component);
|
||||
while(!ComponentArray_end_p(it)) {
|
||||
WidgetComponent* component = *ComponentArray_ref(it);
|
||||
if(component->free) {
|
||||
if(component && component->free) {
|
||||
component->free(component);
|
||||
component->free = NULL;
|
||||
}
|
||||
ComponentArray_next(it);
|
||||
}
|
||||
@@ -1003,6 +1002,7 @@ static void js_widget_destroy(void* inst) {
|
||||
view_dispatcher_stop(widget->view_dispatcher);
|
||||
widget_deinit(widget);
|
||||
}
|
||||
|
||||
widget_remove_view(widget);
|
||||
free(widget);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user