Преглед на файлове

【综合】开启文档、关闭文档卡顿问题优化

tangchao преди 6 месеца
родител
ревизия
0d0fe52413
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarItemView.swift

+ 3 - 3
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarItemView.swift

@@ -34,7 +34,7 @@ extension KMToolbarItemView {
             return self._itemIdentifier
         }
     }
-    var pdfView : CPDFListView = CPDFListView()
+    weak var pdfView: CPDFListView?
 
     lazy var clickButton: KMToolbarClickButton = {
         let view = KMToolbarClickButton()
@@ -831,11 +831,11 @@ extension KMToolbarItemView: KMCustomButtonPopMenuViewControllerDelegate, KMCust
     func itemEnable(at index: Int) -> Bool {
         if self.itemIdentifier == KMToolbarToolFormAlignIdentifier {
             if index <= 6 {
-                if self.pdfView.activeAnnotations.count >= 2 {
+                if let cnt = self.pdfView?.activeAnnotations.count, cnt >= 2 {
                     return true
                 }
             } else {
-                if self.pdfView.activeAnnotations.count >= 3 {
+                if let cnt = self.pdfView?.activeAnnotations.count, cnt >= 3 {
                     return true
                 }
             }