Procházet zdrojové kódy

fix(electron): avoid notifying destroyed window

Andelf před 4 roky
rodič
revize
a393d9f933
1 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. 4 3
      src/electron/electron/fs_watcher.cljs

+ 4 - 3
src/electron/electron/fs_watcher.cljs

@@ -16,9 +16,10 @@
 
 (defonce file-watcher-chan "file-watcher")
 (defn send-file-watcher! [^js win type payload]
-  (.. win -webContents
-      (send file-watcher-chan
-            (bean/->js {:type type :payload payload}))))
+  (when-not (.isDestroyed win)
+    (.. win -webContents
+        (send file-watcher-chan
+              (bean/->js {:type type :payload payload})))))
 
 (defn- publish-file-event!
   [win dir path event]