Skip to content

Commit

Permalink
Fix INSMutableArray::sort_by now that functions are zero-sized.
Browse files Browse the repository at this point in the history
This was EXC_BAD_ACCESSing since that change in rust-lang/rust#19925.
  • Loading branch information
SSheldon committed Jun 19, 2016
1 parent 913ba54 commit f918819
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,11 @@ pub trait INSMutableArray : INSArray {
NSComparisonResult::from_ordering((*compare)(obj1, obj2))
}

let f: extern fn(&Self::Item, &Self::Item, &mut F) -> NSComparisonResult =
compare_with_closure;
let mut closure = compare;
unsafe {
let _: () = msg_send![self, sortUsingFunction:compare_with_closure::<Self::Item, F>
let _: () = msg_send![self, sortUsingFunction:f
context:&mut closure];
}
}
Expand Down

0 comments on commit f918819

Please sign in to comment.