1
0
Fork 1

Fix various memory leaks reported by LeakCanary

- In some places, we weren't nulling out references to destroyed objects. This
  fixes that.
- (These were all discovered via LeakCanary instrumentation, and the fixes are
  hopefully rather straightforward-looking.)

(cherry picked from commit 364502d1a3def0e8895c463b72c8f48e45508214)
This commit is contained in:
eta 2020-10-04 15:02:55 +01:00 committed by Christian Schneppe
parent bbb6940b49
commit f9d7976f73
2 changed files with 23 additions and 0 deletions

View file

@ -1216,6 +1216,14 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
}
return binding.getRoot();
}
@Override
public void onDestroyView() {
super.onDestroyView();
Log.d(Config.LOGTAG,"ConversationFragment.onDestroyView()");
messageListAdapter.setOnContactPictureClicked(null);
messageListAdapter.setOnContactPictureLongClicked(null);
messageListAdapter.setOnQuoteListener(null);
}
@Override
public Animator onCreateAnimator(int transit, boolean enter, int nextAnim) {

View file

@ -121,6 +121,21 @@ public class ConversationsOverviewFragment extends XmppFragment {
}
}
@Override
public void onDestroyView() {
Log.d(Config.LOGTAG,"ConversationsOverviewFragment.onDestroyView()");
super.onDestroyView();
this.binding = null;
this.conversationsAdapter = null;
}
@Override
public void onDestroy() {
Log.d(Config.LOGTAG,"ConversationsOverviewFragment.onDestroy()");
super.onDestroy();
}
@Override
public void onPause() {
Log.d(Config.LOGTAG, "ConversationsOverviewFragment.onPause()");