Skip to content

Commit

Permalink
fixed simulator assert
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 24, 2019
1 parent 132133d commit 554f564
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/eez/gui/widgets/app_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ void AppViewWidget_enum(WidgetCursor &widgetCursor, EnumWidgetsCallback callback
g_dataOperationsFunctions[widgetCursor.widget->data](data::DATA_OPERATION_GET, widgetCursor.cursor, appContextValue);
AppContext *appContext = appContextValue.getAppContext();

assert(g_appContext == widgetCursor.appContext);
auto savedAppContext = widgetCursor.appContext;

WidgetCursor savedWidgetCursor = widgetCursor;
widgetCursor.appContext = appContext;
g_appContext = appContext;

Expand All @@ -70,8 +68,12 @@ void AppViewWidget_enum(WidgetCursor &widgetCursor, EnumWidgetsCallback callback
enumWidgets(widgetCursor, callback);
}

widgetCursor.appContext = savedAppContext;
g_appContext = savedAppContext;
if (widgetCursor.currentState) {
savedWidgetCursor.currentState->size = ((uint8_t *)widgetCursor.currentState) - ((uint8_t *)savedWidgetCursor.currentState);
}

widgetCursor = savedWidgetCursor;
g_appContext = widgetCursor.appContext;
}

} // namespace gui
Expand Down

0 comments on commit 554f564

Please sign in to comment.