mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +00:00
Help: Move-capture help page path
Previously it was reference-captured, causing crash because of stack use after return.
This commit is contained in:
parent
6ddc358a2b
commit
8c082869d0
1 changed files with 2 additions and 2 deletions
|
@ -234,9 +234,9 @@ ErrorOr<void> MainWidget::initialize_fallibles(GUI::Window& window)
|
|||
TRY(go_menu->try_add_action(*m_go_home_action));
|
||||
|
||||
auto help_menu = TRY(window.try_add_menu("&Help"));
|
||||
String const help_page_path = TRY(TRY(try_make_ref_counted<Manual::PageNode>(Manual::sections[1 - 1], TRY(String::from_utf8("Help"sv))))->path());
|
||||
String help_page_path = TRY(TRY(try_make_ref_counted<Manual::PageNode>(Manual::sections[1 - 1], TRY(String::from_utf8("Help"sv))))->path());
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
|
||||
TRY(help_menu->try_add_action(GUI::Action::create("&Contents", { Key_F1 }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-unknown.png"sv)), [&](auto&) {
|
||||
TRY(help_menu->try_add_action(GUI::Action::create("&Contents", { Key_F1 }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-unknown.png"sv)), [this, help_page_path = move(help_page_path)](auto&) {
|
||||
open_page(help_page_path);
|
||||
})));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Help", TRY(GUI::Icon::try_create_default_icon("app-help"sv)), &window)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue