Skip to content

Commit

Permalink
fix(macOS): fixed over release the separator (#120)
Browse files Browse the repository at this point in the history
* fix(macOS): fixed double release the separator

* chore: add chenagfile

* fmt

---------

Co-authored-by: Lucas Nogueira <[email protected]>
  • Loading branch information
pewsheen and lucasfernog authored Sep 12, 2023
1 parent 13c0929 commit f54f1ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-separator-autorelease
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"muda": "patch"
---

On macOS, fixed autorelease from separator twice.
4 changes: 1 addition & 3 deletions src/platform_impl/macos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,7 @@ impl MenuChild {
pub fn create_ns_item_for_predefined_menu_item(&mut self, menu_id: u32) -> crate::Result<id> {
let item_type = self.predefined_item_type.as_ref().unwrap();
let ns_menu_item = match item_type {
PredefinedMenuItemType::Separator => unsafe {
NSMenuItem::separatorItem(nil).autorelease()
},
PredefinedMenuItemType::Separator => unsafe { NSMenuItem::separatorItem(nil) },
_ => create_ns_menu_item(&self.text, item_type.selector(), &self.accelerator)?,
};

Expand Down

0 comments on commit f54f1ef

Please sign in to comment.