-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[TIMOB-25747] iOS: Fix error dialog from not showing up when using main thread #9797
Conversation
iphone/Classes/TiErrorController.m
Outdated
@@ -16,7 +16,19 @@ @implementation TiErrorController | |||
- (id)initWithError:(NSString *)error_ | |||
{ | |||
if (self = [super init]) { | |||
error = [error_ retain]; | |||
error = [NSString stringWithFormat:@"⚠️ %@", [error_ retain]]; |
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.
error is autoreleased object and in dealloc it is released again, it will cause crash. No need of retaining error_ object. It should be -
error = [[NSString alloc] initWithFormat:@"
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.
Copy paste error :-) Fixed!
iphone/Classes/TiErrorController.m
Outdated
error = [NSString stringWithFormat:@"⚠️ %@", [error_ retain]]; | ||
|
||
if (reason_ != nil) { | ||
reason = [NSString stringWithFormat:@"%@", [reason_ retain]]; |
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.
Same as above.
Generated by 🚫 dangerJS |
iphone/Classes/TiErrorController.m
Outdated
@@ -30,6 +42,7 @@ - (void)dealloc | |||
RELEASE_TO_NIL(messageLabel); | |||
RELEASE_TO_NIL(disclosureLabel); | |||
RELEASE_TO_NIL(error); | |||
RELEASE_TO_NIL(reason); |
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.
error and reason objects are autoreleased objects. These are released again here. It'll cause crash.
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.
CR passed.
Already handled via #10022 |
JIRA: https://jira.appcelerator.org/browse/TIMOB-25747
no tests
because it's a UI related change.