Strange crash and fix in getCurrentModifiersRealtime

For Apple specific issues

Strange crash and fix in getCurrentModifiersRealtime

Postby ckk » Fri Jul 13, 2012 11:06 am

Hi Jules,

we ran into a very strange crash in one of our applications and plugins when the mouse moves over a ComboBox popup menu (the item list for selection) while a modifier key is pressed. The crash occured in getCurrentModifiersRealtime(), but we weren't ably to make a simple application with only a ComboBox that reproduces the crash.

What fixed the crash is changing
Code: Select all
ModifierKeys ModifierKeys::getCurrentModifiersRealtime() noexcept
{
    if ([NSEvent respondsToSelector: @selector (modifierFlags)])
        NSViewComponentPeer::updateModifiers ([NSEvent modifierFlags]);
to
Code: Select all
ModifierKeys ModifierKeys::getCurrentModifiersRealtime() noexcept
{
    if ([NSEvent respondsToSelector: @selector (modifierFlags)])
        NSViewComponentPeer::updateModifiers ((NSUInteger) [NSEvent modifierFlags]);
(Casting [NSEvent modifierFlags] to NSUInteger)
in juce_mac_NSViewComponentPeer.mm.

Not sure if this is really needed with the current juce version (we're using an older one; ~2.0.18), but it shouldn't break anything either.


Chris
ckk
JUCE UberWeenie
 
Posts: 218
Joined: Thu May 20, 2010 7:43 pm

Re: Strange crash and fix in getCurrentModifiersRealtime

Postby jules » Fri Jul 13, 2012 11:11 am

Thanks - although this is something I already fixed a couple of weeks ago!
User avatar
jules
Fearless Leader
 
Posts: 17218
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Strange crash and fix in getCurrentModifiersRealtime

Postby ckk » Fri Jul 13, 2012 11:28 am

I did have a look at the current juce tip, but obviously I overlooked that. :oops:

Chris
ckk
JUCE UberWeenie
 
Posts: 218
Joined: Thu May 20, 2010 7:43 pm


Return to MacOSX and iOS

Who is online

Users browsing this forum: No registered users and 2 guests