diff --git a/android/src/main/java/com/pdftron/reactnative/views/DocumentView.java b/android/src/main/java/com/pdftron/reactnative/views/DocumentView.java index 93aa999c..04111414 100644 --- a/android/src/main/java/com/pdftron/reactnative/views/DocumentView.java +++ b/android/src/main/java/com/pdftron/reactnative/views/DocumentView.java @@ -131,7 +131,7 @@ public class DocumentView extends com.pdftron.pdf.controls.DocumentView2 { private String mBase64Extension = ".pdf"; private String mDocumentExtension; - private ArrayList mTempFiles = new ArrayList<>(); + private final ArrayList mTempFiles = new ArrayList<>(); private FragmentManager mFragmentManagerSave; // used to deal with lifecycle issue @@ -139,8 +139,8 @@ public class DocumentView extends com.pdftron.pdf.controls.DocumentView2 { private ToolManagerBuilder mToolManagerBuilder; private ViewerConfig.Builder mBuilder; - private ArrayList mDisabledTools = new ArrayList<>(); - private ArrayList mDisabledButtonTypes = new ArrayList<>(); // used to disabled button types that are with specific a with explicit tool type (e.g. checkmark, dot, cross stamps) + private final ArrayList mDisabledTools = new ArrayList<>(); + private final ArrayList mDisabledButtonTypes = new ArrayList<>(); // used to disabled button types that are with specific a with explicit tool type (e.g. checkmark, dot, cross stamps) private String mExportPath; private String mOpenUrlPath; @@ -2347,14 +2347,12 @@ protected void onDetachedFromWindow() { getViewTreeObserver().removeOnGlobalLayoutListener(mOnGlobalLayoutListener); - if (mTempFiles != null) { - for (File file : mTempFiles) { - if (file != null && file.exists()) { - file.delete(); - } + for (File file : mTempFiles) { + if (file != null && file.exists()) { + file.delete(); } - mTempFiles = null; } + mTempFiles.clear(); } public void onActivityResult(int requestCode, int resultCode, Intent data) { diff --git a/package.json b/package.json index b42c5c87..e0da4a16 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-native-pdftron", "title": "React Native Pdftron", - "version": "3.0.4-14", + "version": "3.0.4-15", "description": "React Native Pdftron", "main": "./lib/index.js", "typings": "index.ts",