[poincare] When memory exception, stay in the app and display popup

This commit is contained in:
Léa Saviot
2018-09-14 13:35:03 +02:00
parent f394a799ea
commit 6deaef49b8
9 changed files with 13 additions and 9 deletions

View File

@@ -143,7 +143,7 @@ bool AppsContainer::processEvent(Ion::Events::Event event) {
return false;
}
void AppsContainer::switchTo(App::Snapshot * snapshot) {
void AppsContainer::switchTo(App::Snapshot * snapshot, bool forceSwitch) {
if (activeApp() && snapshot != activeApp()->snapshot()) {
resetShiftAlphaStatus();
}
@@ -155,7 +155,7 @@ void AppsContainer::switchTo(App::Snapshot * snapshot) {
if (snapshot) {
m_window.setTitle(snapshot->descriptor()->upperName());
}
Container::switchTo(snapshot);
Container::switchTo(snapshot, forceSwitch);
}
void AppsContainer::run() {
@@ -177,9 +177,8 @@ void AppsContainer::run() {
* tree for the jump to work. */
Poincare::ExceptionCheckpoint ecp;
if (!ExceptionRun(ecp)) {
switchTo(appSnapshotAtIndex(0));
activeApp()->displayModalViewController(&m_updateController, 0.f, 0.f); //TODO this is debug
//displayMemoryExhaustionPopUp(); TODO
switchTo(activeApp()->snapshot(), true);
activeApp()->displayWarning(I18n::Message::AppMemoryFull);
}
Container::run();
switchTo(nullptr);