Fix memory leak

This commit is contained in:
Wisest_wizard 2021-12-22 15:32:42 +05:30 committed by GitHub
parent 5832e746f0
commit 86b75c136e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 2 deletions

View File

@ -132,6 +132,13 @@ class StoryViewerFragment : Fragment() {
return root
}
override fun onDestroyView() {
super.onDestroyView()
if (root != null) {
root = null
}
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
if (!shouldRefresh) return
init()
@ -910,4 +917,4 @@ class StoryViewerFragment : Fragment() {
.setNegativeButton(R.string.no, null)
.show()
}
}
}

View File

@ -549,6 +549,7 @@ public class DirectMessageThreadFragment extends Fragment implements DirectReact
public void onDestroyView() {
super.onDestroyView();
cleanup();
binding = null;
}
@Override

View File

@ -278,6 +278,15 @@ public class FeedFragment extends Fragment implements SwipeRefreshLayout.OnRefre
return root;
}
@Override
public void onDestroyView() {
super.onDestroyView();
if (root != null) {
root = null;
binding = null;
}
}
@Override
public void onViewCreated(@NonNull final View view, @Nullable final Bundle savedInstanceState) {
if (!shouldRefresh) return;

View File

@ -1011,4 +1011,4 @@ class ProfileFragment : Fragment(), OnRefreshListener, ConfirmDialogFragmentCall
}
fragment.show(childFragmentManager, PostsLayoutPreferencesDialogFragment::class.java.simpleName)
}
}
}