Skip to content
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

UIWebView call loadRequest multiple times lead to deadlock in iOS12 (fixes #447) #450

Merged
merged 1 commit into from
Mar 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,14 @@ - (void)webViewDidFinishLoad:(UIWebView*)webView
break;

case STATE_WAITING_FOR_LOAD_FINISH:
if (_loadCount == 1) {
// fix call loadRequest multiple times just callback webViewDidFinishLoad once time in iOS 12
if (@available(iOS 12.0, *)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly does this line do?
Does it check for "iOS 12.0"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes,check if the system version is "12.0"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't that mean that is already broken again in 12.1?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like @janpio said, you need to test for iOS 12 and greater. Use IsAtLeastiOSVersion

#define IsAtLeastiOSVersion(X) ([[[UIDevice currentDevice] systemVersion] compare:X options:NSNumericSearch] != NSOrderedAscending)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I test for iOS 12.1 (Xcode Version 10.1 (10B61)),this problem has not been reproduced.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crmo So this fix is just for 12.0 specifically, you mean?

Copy link
Member

@jcesarmobile jcesarmobile Feb 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @available check includes newer versions than the one specified.

fireCallback = YES;
_state = STATE_IDLE;
} else {
if (_loadCount == 1) {
fireCallback = YES;
_state = STATE_IDLE;
}
}
_loadCount -= 1;
break;
Expand Down