[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:
Léa Saviot
2018-11-07 16:40:55 +01:00
committed by Émilie Feral
parent 861ba08198
commit eea56488e6

View File

@@ -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) {