MCPcopy Create free account
hub / github.com/esengine/esengine / dispose

Method dispose

packages/core/src/Core/PluginManager.ts:246–265  ·  view source on GitHub ↗

* 释放资源

()

Source from the content-addressed store, hash-verified

244 * 释放资源
245 */
246 public dispose(): void {
247 // 卸载所有插件(逆序,先卸载依赖项)
248 const plugins = Array.from(this._plugins.values()).reverse();
249
250 for (const plugin of plugins) {
251 try {
252 logger.info(`Disposing plugin: ${plugin.name}`);
253 plugin.uninstall();
254 } catch (error) {
255 logger.error(`Error disposing plugin ${plugin.name}:`, error);
256 }
257 }
258
259 this._plugins.clear();
260 this._metadata.clear();
261 this._core = null;
262 this._services = null;
263
264 logger.info('PluginManager disposed');
265 }
266}

Callers

nothing calls this directly

Calls 7

reverseMethod · 0.80
uninstallMethod · 0.65
clearMethod · 0.65
fromMethod · 0.45
valuesMethod · 0.45
infoMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected