diff options
author | 2018-02-07 16:24:01 +0100 | |
---|---|---|
committer | 2018-02-07 16:24:01 +0100 | |
commit | c99848fe96bd93196882462b2d57aa77d34894a0 (patch) | |
tree | f6ecd4286e3575aa503f2f608498577c0bb4da76 /src/stores | |
parent | fix `isDevMode` import (diff) | |
download | ferdium-app-c99848fe96bd93196882462b2d57aa77d34894a0.tar.gz ferdium-app-c99848fe96bd93196882462b2d57aa77d34894a0.tar.zst ferdium-app-c99848fe96bd93196882462b2d57aa77d34894a0.zip |
fix(App): Bugfix Fix memory leak in recipe polling loop
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/ServicesStore.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 20e07e540..349a609a1 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -589,12 +589,16 @@ export default class ServicesStore extends Store { | |||
589 | const delay = 1000; | 589 | const delay = 1000; |
590 | 590 | ||
591 | if (service) { | 591 | if (service) { |
592 | if (service.timer !== null) { | ||
593 | clearTimeout(service.timer) | ||
594 | } | ||
595 | |||
592 | const loop = () => { | 596 | const loop = () => { |
593 | if (!service.webview) return; | 597 | if (!service.webview) return; |
594 | 598 | ||
595 | service.webview.send('poll'); | 599 | service.webview.send('poll'); |
596 | 600 | ||
597 | setTimeout(loop, delay); | 601 | service.timer = setTimeout(loop, delay); |
598 | }; | 602 | }; |
599 | 603 | ||
600 | loop(); | 604 | loop(); |