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:
parent
bbb6940b49
commit
f9d7976f73
2 changed files with 23 additions and 0 deletions
|
@ -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) {
|
||||
|
|
|
@ -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()");
|
||||
|
|
Loading…
Add table
Reference in a new issue