Parcourir la source

PDFTool(Android) - v2.0.1 替换sdk, 优化内存占用问题

liuxiaolong il y a 7 mois
Parent
commit
9f841e63d1

BIN
ComPDFKit_Repo/compdfkit/ComPDFKit.aar


+ 13 - 0
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/CPDFDocumentFragment.java

@@ -799,4 +799,17 @@ public class CPDFDocumentFragment extends CBasicPDFFragment {
     protected interface CRequestPermissionListener {
         void request();
     }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        try {
+            if (pdfView.getCPdfReaderView().getPDFDocument() != null) {
+                pdfView.getCPdfReaderView().getPDFDocument().close();
+            }
+        }catch (Exception e){
+
+        }
+
+    }
 }