1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:17:35 +00:00

GMLPlayground: Keep view_frame_action around to prevent a crash

The `view_frame_action` variable only exists for the duration of
`initialize_menubar()`, so calling it in `m_preview_window->on_close`
would crash. This fixes that by storing the action pointer inside
MainWidget. (And storing the `view_window_action` too because it felt
weird storing one and not the other.)
This commit is contained in:
Sam Atkins 2023-05-16 16:36:39 +01:00 committed by Sam Atkins
parent e938860126
commit f3fe9b64bf
2 changed files with 11 additions and 8 deletions

View file

@ -42,7 +42,10 @@ private:
RefPtr<GUI::Window> m_preview_window;
RefPtr<GUI::Widget> m_preview_window_widget;
GUI::Widget* m_preview;
GUI::ActionGroup m_views_group;
RefPtr<GUI::Action> m_view_frame_action;
RefPtr<GUI::Action> m_view_window_action;
GUI::Icon m_icon;
DeprecatedString m_file_path;