Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Fix crash when the app is closed while playing 360 videos #1771

Merged
merged 1 commit into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
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 @@ -395,8 +395,6 @@ protected void onDestroy() {
}

// Remove all widget listeners
mTray.removeListeners(mWindows);
mTray.onDestroy();
mWindows.onDestroy();

SessionStore.get().onDestroy();
Expand Down Expand Up @@ -1207,7 +1205,9 @@ public void popWorldBrightness(Object aKey) {

@Override
public void setTrayVisible(boolean visible) {
mTray.setTrayVisible(visible);
if (mTray != null && !mTray.isReleased()) {
mTray.setTrayVisible(visible);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,6 @@ public void removeListeners(TrayListener... listeners) {
mTrayListeners.removeAll(Arrays.asList(listeners));
}

public void onDestroy() {
mTrayListeners.clear();
}

private void notifyBookmarksClicked() {
mTrayListeners.forEach(TrayListener::onBookmarksClicked);
}
Expand Down Expand Up @@ -266,6 +262,7 @@ public void releaseWidget() {
}

mWidgetManager.removeUpdateListener(this);
mTrayListeners.clear();

super.releaseWidget();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public interface Delegate {
protected int mBorderWidth;
private Runnable mFirstDrawCallback;
protected boolean mResizing = false;
protected boolean mReleased = false;

public UIWidget(Context aContext) {
super(aContext);
Expand Down Expand Up @@ -203,6 +204,11 @@ private void releaseRenderer() {
public void releaseWidget() {
releaseRenderer();
mWidgetManager = null;
mReleased = true;
}

public boolean isReleased() {
return mReleased;
}

@Override
Expand Down