diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java index 922fa85e9..15974848f 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java @@ -374,8 +374,13 @@ public void releaseWidget() { } detachFromWindow(); - mAttachedWindow = null; + + if (mSendTabDialog != null && !mSendTabDialog.isReleased()) { + mSendTabDialog.releaseWidget(); + } + mSendTabDialog = null; + super.releaseWidget(); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TabsWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TabsWidget.java index 8fd892095..5e3a24913 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TabsWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TabsWidget.java @@ -159,6 +159,10 @@ public void attachToWindow(WindowWidget aWindow) { @Override public void releaseWidget() { + if (mSendTabDialog != null && !mSendTabDialog.isReleased()) { + mSendTabDialog.releaseWidget(); + } + mSendTabDialog = null; super.releaseWidget(); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java index ee025fa22..06cc74768 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java @@ -459,6 +459,10 @@ public void onResume() { } public void onDestroy() { + if (mTabsWidget != null && !mTabsWidget.isReleased()) { + mTabsWidget.releaseWidget(); + mTabsWidget = null; + } mDelegate = null; for (WindowWidget window: mRegularWindows) { window.close(); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/UIDialog.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/UIDialog.java index e7a50f9f5..d7c73caf0 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/UIDialog.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/UIDialog.java @@ -33,7 +33,9 @@ private void initialize() { @Override public void releaseWidget() { - mWidgetManager.removeWorldClickListener(this); + if (mWidgetManager != null) { + mWidgetManager.removeWorldClickListener(this); + } mDialogs.remove(this); super.releaseWidget(); }