Forráskód Böngészése

Fix a log streaming memory leak

Fixes a memory leak caused by not reinitialising the JS array object
when adding new lines to the stream after the stream maximum lines have
been reached.
Sergiu Miclea 6 éve
szülő
commit
eb2b3f4e88
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      src/stores/LogStore.js

+ 1 - 1
src/stores/LogStore.js

@@ -99,7 +99,7 @@ class LogStore {
   @action addToLiveFeed(feed: { message: string }) {
     this.liveFeed = [...this.liveFeed, feed.message]
     if (this.liveFeed.length > MAX_STREAM_LINES) {
-      this.liveFeed = this.liveFeed.filter((f, i) => i > this.liveFeed.length - MAX_STREAM_LINES)
+      this.liveFeed = [...this.liveFeed.filter((f, i) => i > this.liveFeed.length - MAX_STREAM_LINES)]
     }
   }