From 51ebdf4ed2433822c55f82fab9b1f4f044e15b25 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 14 Dec 2020 12:06:18 +0100 Subject: [PATCH] Clear throttled functions in cache --- www/common/outer/async-store.js | 3 +++ www/common/outer/cache-store.js | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index afb799990..da7abf9d0 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -2277,6 +2277,9 @@ define([ try { store.onlyoffice.leavePad(chanId); } catch (e) { console.error(e); } + try { + Cache.leaveChannel(chanId); + } catch (e) { console.error(e); } if (!Store.channels[chanId]) { return; } diff --git a/www/common/outer/cache-store.js b/www/common/outer/cache-store.js index ad9f1e04f..4b21e22fe 100644 --- a/www/common/outer/cache-store.js +++ b/www/common/outer/cache-store.js @@ -117,6 +117,13 @@ define([ }); }; + S.leaveChannel = function (id) { + if (t[id] && typeof(t[id].clear) === "function") { + t[id].clear(); + } + delete t[id]; + }; + S.clearChannel = function (id, cb) { cb = Util.once(Util.mkAsync(cb || function () {}));