forked from apache/cordova-plugin-inappbrowser
-
Notifications
You must be signed in to change notification settings - Fork 1
[Android] IAB 종료시 발생하는 메모리 누수 수정 #12
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
Open
zb-sj
wants to merge
3
commits into
hogangnono:master
Choose a base branch
from
PDLMobileApps:bug-290
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -539,8 +539,9 @@ - (void)webView:(WKWebView *)theWebView decidePolicyForNavigationAction:(WKNavig | |||||||||
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId]; | ||||||||||
} | ||||||||||
|
||||||||||
//if is an app store link, let the system handle it, otherwise it fails to load it | ||||||||||
if ([[ url scheme] isEqualToString:@"itms-appss"] || [[ url scheme] isEqualToString:@"itms-apps"]) { | ||||||||||
//if is an app store, tel, sms, mailto or geo link, let the system handle it, otherwise it fails to load it | ||||||||||
NSArray * allowedSchemes = @[@"itms-appss", @"itms-apps", @"tel", @"sms", @"mailto", @"geo"]; | ||||||||||
if ([allowedSchemes containsObject:[url scheme]]) { | ||||||||||
Comment on lines
+543
to
+544
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
[theWebView stopLoading]; | ||||||||||
[self openInSystem:url]; | ||||||||||
shouldStart = NO; | ||||||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
이 코드는 몇 가지 잠재적인 문제를 가지고 있습니다.
new String("about:blank")
는 호출될 때마다 불필요한 새 문자열 객체를 생성합니다. 문자열 리터럴"about:blank"
를 직접 사용하는 것이 더 효율적입니다.url.equals(...)
는url
이null
일 경우NullPointerException
을 발생시킬 수 있습니다."about:blank".equals(url)
과 같이 리터럴에 대해equals
를 호출하는 것이 더 안전합니다.onPageFinished
콜백 내에서 인스턴스 변수인inAppWebView
를 직접 사용하면 경합 상태(race condition)가 발생할 수 있습니다. 예를 들어, 이WebView
가 닫히기 전에 다른InAppBrowser
가 열리면inAppWebView
는 새WebView
를 가리키게 되어, 결국 잘못된WebView
를 닫게 될 수 있습니다. 콜백의view
파라미터를 사용하여 올바른WebView
인스턴스를 조작해야 합니다.