mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps] Tidy snapshots when leaving the app following an exception
This commit is contained in:
committed by
LeaNumworks
parent
fb44f8617c
commit
10556b477b
@@ -252,6 +252,17 @@ void AppsContainer::run() {
|
||||
} else {
|
||||
// Exception
|
||||
if (activeApp() != nullptr) {
|
||||
/* The app models can reference layouts or expressions that have been
|
||||
* destroyed from the pool. To avoid using them before packing the app
|
||||
* (in App::willBecomeInactive for instance), we tidy them early on. */
|
||||
activeApp()->snapshot()->tidy();
|
||||
/* When an app encoutered an exception due to a full pool, the next time
|
||||
* the user enters the app, the same exception could happen again which
|
||||
* would prevent from reopening the app. To avoid being stuck outside the
|
||||
* app causing the issue, we reset its snapshot when leaving it due to
|
||||
* exception. For instance, the calculation app can encounter an
|
||||
* exception when displaying too many huge layouts, if we don't clean the
|
||||
* history here, we will be stuck outside the calculation app. */
|
||||
activeApp()->snapshot()->reset();
|
||||
}
|
||||
switchTo(appSnapshotAtIndex(0));
|
||||
|
||||
@@ -39,7 +39,6 @@ public:
|
||||
#if EPSILON_GETOPT
|
||||
virtual void setOpt(const char * name, char * value) {}
|
||||
#endif
|
||||
private:
|
||||
/* tidy clean all dynamically-allocated data */
|
||||
virtual void tidy();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user