Skip to content

Commit

Permalink
Clear component cache in unload_main method of SmartEnv class
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Brian Joseph Petro committed Jan 11, 2025
1 parent c4f07ab commit f7719b2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions smart-environment/smart_env.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f7719b2

Please sign in to comment.