Fix memory leak in PreviewFragment

This commit is contained in:
William Brawner 2017-11-29 08:33:45 -06:00 committed by William Brawner
parent cd564ad363
commit a42e375798

View file

@ -71,8 +71,12 @@ public class PreviewFragment extends Fragment implements MarkdownPreviewView {
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); if (markdownPreview != null) {
((ViewGroup) markdownPreview.getParent()).removeView(markdownPreview);
markdownPreview.destroy();
}
unbinder.unbind(); unbinder.unbind();
super.onDestroyView();
} }
@Override @Override