Skip to content

DisposableStore doesn't fail fast but obscure #77192

@jrieken

Description

@jrieken

console.warn(new Error('Registering disposable on object that has already been disposed of').stack);
t.dispose();

🔝 That's quite mean because instead of throwing an error at the spot it disposes whatever has been given to it and therefore causes all kinds of errors later down the road. This issue is an example: #76769 of "random" carnage due to unexpected disposal and I was lucky to spot one occurrence of that warning. This fix was trivial, calling clear instead of dispose, an error that often happens during this refactoring.

So, either only warn and don't dispose or throw a real error.

Metadata

Metadata

Assignees

Labels

debtCode quality issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions