Ensure the OverlayStack is cleared when the app loop finishes.

This commit is contained in:
casey 2016-09-02 10:19:05 -07:00
parent 2a819eb0ad
commit 7e60827aab
3 changed files with 10 additions and 0 deletions

View File

@ -230,6 +230,8 @@ void App::Run(ILayoutPtr layout) {
MessageQueue::Instance().Dispatch();
}
overlays.Clear();
}
void App::UpdateFocusedWindow(IWindowPtr window) {

View File

@ -93,4 +93,8 @@ void OverlayStack::Remove(ILayout* layout) {
setOverlayStack(*it, nullptr);
this->stack.erase(it);
}
}
void OverlayStack::Clear() {
this->stack.clear();
}

View File

@ -46,6 +46,10 @@ namespace cursespp {
void Remove(ILayoutPtr layout);
void Remove(ILayout* layout);
protected:
friend class App;
void Clear(); /* don't want this exposed to the public */
private:
std::vector<ILayoutPtr> stack;
};