Skip to content

Commit 648fa69

Browse files
committed
fix: shutdown ImageLoader when onDropViewInstance
1 parent e5bb712 commit 648fa69

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,10 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) {
384384
updateTextAppearance()
385385
}
386386

387+
fun shutdownImageLoader() {
388+
imageLoader.shutdown()
389+
}
390+
387391
private fun updateTextAppearance() {
388392
if (fontSize != null || fontFamily != null || fontWeight != null) {
389393
val menuView = bottomNavigation.getChildAt(0) as? ViewGroup ?: return
@@ -455,9 +459,4 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) {
455459
updateItems(items)
456460
uiModeConfiguration = newConfig?.uiMode ?: uiModeConfiguration
457461
}
458-
459-
override fun onDetachedFromWindow() {
460-
super.onDetachedFromWindow()
461-
imageLoader.shutdown()
462-
}
463462
}

packages/react-native-bottom-tabs/android/src/newarch/RCTTabViewManager.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ class RCTTabViewManager(context: ReactApplicationContext) :
4343

4444
}
4545

46+
override fun onDropViewInstance(view: ReactBottomNavigationView) {
47+
super.onDropViewInstance(view)
48+
view.shutdownImageLoader()
49+
}
50+
4651
override fun getName(): String {
4752
return tabViewImpl.getName()
4853
}

0 commit comments

Comments
 (0)