mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-18 19:28:02 -04:00
Use std::unique_ptr inside NavigationView.
This commit is contained in:
parent
18c4672ba2
commit
969d9bd070
2 changed files with 9 additions and 9 deletions
|
@ -59,9 +59,7 @@ public:
|
|||
|
||||
template<class T, class... Args>
|
||||
T* push(Args&&... args) {
|
||||
const auto new_view = new T(std::forward<Args>(args)...);
|
||||
push_view(new_view);
|
||||
return reinterpret_cast<T*>(new_view);
|
||||
return reinterpret_cast<T*>(push_view(std::unique_ptr<View>(new T(std::forward<Args>(args)...))));
|
||||
}
|
||||
|
||||
void pop();
|
||||
|
@ -69,13 +67,13 @@ public:
|
|||
void focus() override;
|
||||
|
||||
private:
|
||||
std::vector<View*> view_stack;
|
||||
std::vector<std::unique_ptr<View>> view_stack;
|
||||
|
||||
Widget* view() const;
|
||||
|
||||
void free_view();
|
||||
void update_view();
|
||||
void push_view(View* new_view);
|
||||
View* push_view(std::unique_ptr<View> new_view);
|
||||
};
|
||||
|
||||
class SystemMenuView : public MenuView {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue