提交 d37f7c15 编写于 作者: M Matt Bierner

Always dispose of DecorationCSSRules

Found while looking into #63467

There's potential leak for `DecorationCSSRules`. Currently we only dipose of them if `hasContent` is true, which I'm not sure guarantees that these classes are truely non-disposable

With this change, we always dispose of them. At worst, these extra dispose call should be noops
上级 02a59c30
......@@ -141,18 +141,18 @@ class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider {
this.refCount = 0;
this._disposables = [];
let createCSSRules = (type: ModelDecorationCSSRuleType) => {
let rules = new DecorationCSSRules(type, providerArgs, themeService);
if (rules.hasContent) {
const createCSSRules = (type: ModelDecorationCSSRuleType) => {
const rules = new DecorationCSSRules(type, providerArgs, themeService);
this._disposables.push(rules);
if (rules.hasContent) {
return rules.className;
}
return void 0;
};
let createInlineCSSRules = (type: ModelDecorationCSSRuleType) => {
let rules = new DecorationCSSRules(type, providerArgs, themeService);
if (rules.hasContent) {
const createInlineCSSRules = (type: ModelDecorationCSSRuleType) => {
const rules = new DecorationCSSRules(type, providerArgs, themeService);
this._disposables.push(rules);
if (rules.hasContent) {
return { className: rules.className, hasLetterSpacing: rules.hasLetterSpacing };
}
return null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册