mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 15:50:49 +01:00
[escher] Only one app is on the heap at one time
Change-Id: I6c77601cb0cc883083a4dd05370ca543fa7951cc
This commit is contained in:
@@ -7,14 +7,20 @@ Container::Container() :
|
||||
{
|
||||
}
|
||||
|
||||
void Container::switchTo(App * app) {
|
||||
if (m_activeApp == app) {
|
||||
return;
|
||||
Container::~Container() {
|
||||
if (m_activeApp) {
|
||||
delete m_activeApp;
|
||||
}
|
||||
}
|
||||
|
||||
void Container::switchTo(App::Descriptor * descriptor) {
|
||||
if (m_activeApp) {
|
||||
m_activeApp->willBecomeInactive();
|
||||
delete m_activeApp;
|
||||
}
|
||||
if (descriptor) {
|
||||
m_activeApp = descriptor->build(this);
|
||||
}
|
||||
m_activeApp = app;
|
||||
if (m_activeApp) {
|
||||
m_activeApp->didBecomeActive(window());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user