Explorar o código

fix: memory leak with browser assets in db graphs

Db graph image were recursively generating blobs which caused a memory
link. Put a nil check to prevent the recursion
Gabriel Horner hai 1 ano
pai
achega
7693642298
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  1. 5 4
      src/main/frontend/components/block.cljs

+ 5 - 4
src/main/frontend/components/block.cljs

@@ -380,10 +380,11 @@
   (let [src (::src state)
         granted? (state/sub [:nfs/user-granted? (state/get-current-repo)])
         href (config/get-local-asset-absolute-path href)]
-    (when (or granted?
-              (util/electron?)
-              (mobile-util/native-platform?)
-              (config/db-based-graph? (state/get-current-repo)))
+    (when (and (or granted?
+                   (util/electron?)
+                   (mobile-util/native-platform?)
+                   (config/db-based-graph? (state/get-current-repo)))
+               (nil? @src))
       (p/then (editor-handler/make-asset-url href) #(reset! src %)))
 
     (when @src