Skip to content

App crashes when clicking on a menu item on macOS #202

@Korne127

Description

@Korne127

I added a dummy menu:

fn create_menu() {
    let menu = Menu::with_items(&[
        &Submenu::with_items(
            "",
            true,
            &[&MenuItem::new(
                "Menu item",
                true,
                Some(Accelerator::new(Some(Modifiers::SUPER), Code::KeyD)),
            )],
        )
        .unwrap(),
    ])
    .unwrap();
    menu.init_for_nsapp();
}

to a macOS application which uses winit.
However, when I click on the menu item (or any menu item if I add several), the app crashes with

unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed isize::MAX

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions