clean up references in ChatFragment

This commit is contained in:
Daniel Gultsch 2023-04-01 13:59:48 +02:00
parent e6bf595388
commit c858b5346f
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -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;
}
}