mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[apps] Fix VarBoxController::viewDidDisappear parent method call order
Before, we tidied the memoization before calling the parent's viewDidDisappear method. As the parent method needed some cell heights, it used the VarBoxController memoization, thus re-creating layouts that would stay in the pool after closing the app. Scenario: Go in the Graph app, create f(x) = 1, empty g(x) and h(x), create p(x) and while editing go in the variable box controller, all the way down, then hit the Home button.
This commit is contained in:
@@ -32,13 +32,20 @@ void VariableBoxController::viewDidDisappear() {
|
||||
if (isDisplayingEmptyController()) {
|
||||
pop();
|
||||
}
|
||||
// Tidy the layouts used to display the VariableBoxController to clean TreePool
|
||||
|
||||
NestedMenuController::viewDidDisappear();
|
||||
|
||||
/* NestedMenuController::viewDidDisappear might need cell heights, which would
|
||||
* use the VariableBoxController cell heights memoization. We thus reset the
|
||||
* VariableBoxController layouts only after calling the parent's
|
||||
* viewDidDisappear. */
|
||||
|
||||
// Tidy the layouts displayed in the VariableBoxController to clean TreePool
|
||||
for (int i = 0; i < k_maxNumberOfDisplayedRows; i++) {
|
||||
m_leafCells[i].setLayout(Layout());
|
||||
m_leafCells[i].setAccessoryLayout(Layout());
|
||||
}
|
||||
resetMemoization();
|
||||
NestedMenuController::viewDidDisappear();
|
||||
}
|
||||
|
||||
bool VariableBoxController::handleEvent(Ion::Events::Event event) {
|
||||
|
||||
Reference in New Issue
Block a user