Skip to content

Commit 48b219d

Browse files
committed
Make sure we clear all the views onDestroy
1 parent b805732 commit 48b219d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

media-placeholders/src/main/java/org/wordpress/aztec/placeholders/PlaceholderManager.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ class PlaceholderManager(
5959
}
6060

6161
fun onDestroy() {
62+
positionToId.forEach {
63+
container.findViewWithTag<View>(it.uuid)?.let { placeholder ->
64+
container.removeView(placeholder)
65+
}
66+
}
67+
positionToId.clear()
6268
aztecText.contentChangeWatcher.unregisterObserver(this)
6369
adapters.values.forEach { it.onDestroy() }
6470
adapters.clear()

0 commit comments

Comments
 (0)