From f267f6824556898cdcf0f33729266d348a38b4d9 Mon Sep 17 00:00:00 2001 From: Grishka Date: Tue, 19 Apr 2022 07:03:35 +0300 Subject: [PATCH] Crash fix --- .../joinmastodon/android/fragments/ComposeFragment.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java index 21bc3aa6..8025e9dd 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java @@ -211,6 +211,13 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis } } + @Override + public void onDestroy(){ + super.onDestroy(); + if(uploadingAttachment!=null && uploadingAttachment.uploadRequest!=null) + uploadingAttachment.uploadRequest.cancel(); + } + @Override public void onAttach(Activity activity){ super.onAttach(activity);