@xterm/xterm 5.4.0-beta.13 → 5.4.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xterm/xterm",
3
3
  "description": "Full xterm terminal, in your browser",
4
- "version": "5.4.0-beta.13",
4
+ "version": "5.4.0-beta.15",
5
5
  "main": "lib/xterm.js",
6
6
  "style": "css/xterm.css",
7
7
  "types": "typings/xterm.d.ts",
@@ -39,6 +39,9 @@ export class Linkifier2 extends Disposable implements ILinkifier2 {
39
39
  this.register(getDisposeArrayDisposable(this._linkCacheDisposables));
40
40
  this.register(toDisposable(() => {
41
41
  this._lastMouseEvent = undefined;
42
+ // Clear out link providers as they could easily cause an embedder memory leak
43
+ this._linkProviders.length = 0;
44
+ this._activeProviderReplies?.clear();
42
45
  }));
43
46
  // Listen to resize to catch the case where it's resized and the cursor is out of the viewport.
44
47
  this.register(this._bufferService.onResize(() => {
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { EventEmitter } from 'common/EventEmitter';
7
- import { Disposable } from 'common/Lifecycle';
7
+ import { Disposable, toDisposable } from 'common/Lifecycle';
8
8
  import { isMac } from 'common/Platform';
9
9
  import { CursorStyle, IDisposable } from 'common/Types';
10
10
  import { FontWeight, IOptionsService, ITerminalOptions } from 'common/services/Services';
@@ -86,6 +86,13 @@ export class OptionsService extends Disposable implements IOptionsService {
86
86
  this.rawOptions = defaultOptions;
87
87
  this.options = { ... defaultOptions };
88
88
  this._setupOptions();
89
+
90
+ // Clear out options that could link outside xterm.js as they could easily cause an embedder
91
+ // memory leak
92
+ this.register(toDisposable(() => {
93
+ this.rawOptions.linkHandler = null;
94
+ this.rawOptions.documentOverride = null;
95
+ }));
89
96
  }
90
97
 
91
98
  // eslint-disable-next-line @typescript-eslint/naming-convention