Prechádzať zdrojové kódy

【2025】【搜索】- 页面关闭后搜索界面关闭发生crash问题暂时解法

yangliuhua 3 týždňov pred
rodič
commit
1923a7e0eb

+ 4 - 4
PDF Office/PDF Master/KMClass/Left/Search/Window/KMSearchReplaceWindowController.swift

@@ -142,13 +142,13 @@ class KMSearchReplaceWindowController: KMNBaseWindowController {
         titleBarBox.borderWidth = 0
         titleBarBox.contentView = titleBarView_
         titleBarView_.titleLabel.font = .SFProTextRegularFont(14)
-        titleBarView_.itemClick = { [unowned self] idx, _ in
+        titleBarView_.itemClick = { [weak self] idx, _ in
             if idx == 1 {
-                _closeAction(NSButton())
+                self?._closeAction(NSButton())
             } else if idx == 2 {
-                _closeAction(NSButton())
+                self?._closeAction(NSButton())
                 
-                itemClick?(1, handdler)
+                self?.itemClick?(1, self?.handdler)
             }
         }