Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
10db7a9c
authored
May 01, 2020
by
ibaker
Committed by
Oliver Woodman
May 01, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Ensure we destroy WebViews when we detach them from SubtitleView
PiperOrigin-RevId: 309389731
parent
79c003f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitleView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitleWebView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitleView.java
View file @
10db7a9c
...
...
@@ -143,6 +143,9 @@ public final class SubtitleView extends FrameLayout implements TextOutput {
private
<
T
extends
View
&
Output
>
void
setView
(
T
view
)
{
removeView
(
innerSubtitleView
);
if
(
innerSubtitleView
instanceof
SubtitleWebView
)
{
((
SubtitleWebView
)
innerSubtitleView
).
destroy
();
}
innerSubtitleView
=
view
;
output
=
view
;
addView
(
view
);
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitleWebView.java
View file @
10db7a9c
...
...
@@ -174,6 +174,17 @@ import java.util.List;
updateWebView
();
}
/**
* Cleans up internal state, including calling {@link WebView#destroy()} on the delegate view.
*
* <p>This method may only be called after this view has been removed from the view system. No
* other methods may be called on this view after destroy.
*/
public
void
destroy
()
{
cues
.
clear
();
webView
.
destroy
();
}
private
void
updateWebView
()
{
StringBuilder
html
=
new
StringBuilder
();
html
.
append
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment