Skip to content

Commit

Permalink
fix C++ memory crash
Browse files Browse the repository at this point in the history
Summary:
blocks don't capture C++ objects so this will would crash

Changelog: [iOS][Internal]

Reviewed By: sammy-SC, cipolleschi

Differential Revision: D53572123
  • Loading branch information
philIip authored and facebook-github-bot committed Feb 8, 2024
1 parent 50bd9e3 commit c5c5089
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-native/React/CoreModules/RCTAlertManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ - (void)invalidate
NSString *destructiveButtonKey = [RCTConvert NSString:args.destructiveButtonKey()];
NSString *preferredButtonKey = [RCTConvert NSString:args.preferredButtonKey()];
UIKeyboardType keyboardType = [RCTConvert UIKeyboardType:args.keyboardType()];
UIUserInterfaceStyle userInterfaceStyle = [RCTConvert UIUserInterfaceStyle:args.userInterfaceStyle()];

if (!title && !message) {
RCTLogError(@"Must specify either an alert title, or message, or both");
Expand All @@ -108,7 +109,6 @@ - (void)invalidate
message:nil
preferredStyle:UIAlertControllerStyleAlert];

UIUserInterfaceStyle userInterfaceStyle = [RCTConvert UIUserInterfaceStyle:args.userInterfaceStyle()];
alertController.overrideUserInterfaceStyle = userInterfaceStyle;

switch (type) {
Expand Down

0 comments on commit c5c5089

Please sign in to comment.