From f7719b225de48dd9418f51a76ebe7c11150d5527 Mon Sep 17 00:00:00 2001 From: Brian Joseph Petro Date: Sat, 11 Jan 2025 14:42:55 -0500 Subject: [PATCH] Clear component cache in unload_main method of SmartEnv class - Added a line to reset the `_components` property to an empty object in the `unload_main` method, ensuring that the component cache is cleared when unloading collections and options. - This change improves memory management and prevents potential issues related to stale component references during the unloading process. --- smart-environment/smart_env.js | 1 + 1 file changed, 1 insertion(+) diff --git a/smart-environment/smart_env.js b/smart-environment/smart_env.js index 2298ae1a..e9b31405 100644 --- a/smart-environment/smart_env.js +++ b/smart-environment/smart_env.js @@ -195,6 +195,7 @@ export class SmartEnv { } unload_main(main_key) { + this._components = {}; // clear component cache this.unload_collections(main_key); this.unload_opts(main_key); this[main_key] = null;