muda icon indicating copy to clipboard operation
muda copied to clipboard

App crashes when clicking on a menu item on macOS

Open Korne127 opened this issue 8 months ago • 6 comments

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

Korne127 avatar Jun 24 '24 22:06 Korne127