-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[macOS] Fix wrong object type in joypad queue. #95425
Conversation
@@ -228,7 +228,7 @@ @interface JoypadMacOSObserver () | |||
@property(assign, nonatomic) BOOL isObserving; | |||
@property(assign, nonatomic) BOOL isProcessing; | |||
@property(strong, nonatomic) NSMutableDictionary<NSNumber *, Joypad *> *connectedJoypads; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this one? I'm not familiar with that code but I see it used as GCController too:
217: GCController *controller = [self.connectedJoypads objectForKey:key];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in iOS code, it's a bit different and always using GCController *
.
@@ -228,7 +228,7 @@ @interface JoypadMacOSObserver () | |||
@property(assign, nonatomic) BOOL isObserving; | |||
@property(assign, nonatomic) BOOL isProcessing; | |||
@property(strong, nonatomic) NSMutableDictionary<NSNumber *, Joypad *> *connectedJoypads; | |||
@property(strong, nonatomic) NSMutableArray<Joypad *> *joypadsQueue; | |||
@property(strong, nonatomic) NSMutableArray<GCController *> *joypadsQueue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, the joypad_ios.mm
implementation seems similar but doesn't specify the types for the NSMutableArray
and NSMutableDictionary
used here. Should that be harmonized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of iOS it should be:
@property(strong, nonatomic) NSMutableDictionary<NSNumber *, GCController *> *connectedJoypads;
@property(strong, nonatomic) NSMutableArray<GCController *> *joypadsQueue;
Probably worth merging both int a single file, it's using the same API and code should be almost same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I'd guess that should be for a follow-up 4.4 PR, as I'm evaluating whether this one should be merged for 4.3.
Thanks! |
joypadsQueue
expected to haveGCController *
when it's read, butJoypad *
was pushed to it.Should fix #95365
I can't reproduce the issue in normal conditions, but can reproduce it by delaying
start_processing
.