From c858b5346faf050b1ebcaac973f617620fba7451 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 1 Apr 2023 13:59:48 +0200 Subject: [PATCH] clean up references in ChatFragment --- .../android/ui/fragment/main/ChatFragment.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/src/main/java/im/conversations/android/ui/fragment/main/ChatFragment.java b/app/src/main/java/im/conversations/android/ui/fragment/main/ChatFragment.java index 2fa6f054b..dcf858c3e 100644 --- a/app/src/main/java/im/conversations/android/ui/fragment/main/ChatFragment.java +++ b/app/src/main/java/im/conversations/android/ui/fragment/main/ChatFragment.java @@ -145,4 +145,18 @@ public class ChatFragment extends Fragment { FlashBackgroundDrawable.flashBackground(view, messageId); } } + + @Override + public void onDestroyView() { + nullReferences(); + super.onDestroyView(); + } + + private void nullReferences() { + this.binding.messages.setAdapter(null); + this.recyclerViewScroller = null; + this.messageAdapter.setOnNavigateToInReplyTo(null); + this.messageAdapter = null; + this.binding = null; + } }