Fix memory leak in PreviewFragment

This commit is contained in:
William Brawner 2017-11-29 08:33:45 -06:00
parent e96aaba251
commit 414defaf47

View file

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