diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps')
3 files changed, 8 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt index 13253bcf..0f3a1e52 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt @@ -485,10 +485,10 @@ abstract class BaseMainActivity : BaseActivity(), MainActivityContract, } override fun onDestroy() { - fragmentChannel.close() - headerBadgeChannel.close() controlWebview?.destroy() super.onDestroy() + fragmentChannel.close() + headerBadgeChannel.close() } override fun collapseAppBar() { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt index 9a0c6270..230c1a55 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt @@ -66,7 +66,11 @@ class MainActivity : BaseMainActivity() { } } }) - viewPager.post { fragmentChannel.offer(0); lastPosition = 0 } //trigger hook so title is set + viewPager.post { + if (!fragmentChannel.isClosedForSend) + fragmentChannel.offer(0) + lastPosition = 0 + } //trigger hook so title is set } private fun setupTabs() { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentBase.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentBase.kt index ea549026..0000195c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentBase.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentBase.kt @@ -209,11 +209,11 @@ abstract class BaseFragment : Fragment(), CoroutineScope, FragmentContract, Dyna } override fun onDestroyView() { + super.onDestroyView() L.i { "Fragment on destroy $position ${hashCode()}" } content?.destroy() content = null detachMainObservable() - super.onDestroyView() } override fun onDestroy() { |