fix: memory leak in QuickDiffModel #265007
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before (Typing in editor 197 times):
When typing into the editor 197 times, it seems that the number of QuickDiffModel functions increases by one each time.
The json lists
src/vs/workbench/contrib/scm/browser/quickDiffModel.ts:232:10as source:After registering the
_diffDelayerdisposable, the issue seems to be resolved.JSON Data Details
{ "namedFunctionCount3": [ { "count": 203, "delta": 203, "name": "anonymous", "sourceLocation": "vscode-file://vscode-app/workspace/vscode-memory-leak-finder/.vscode-test/vscode-linux-x64-1.103.2/resources/app/out/vs/workbench/workbench.desktop.main.js:569:18762", "originalLocation": "src/vs/workbench/contrib/comments/browser/commentsController.ts:710:11", "originalName": "CommentController.beginComputeCommentingRanges" }, { "count": 203, "delta": 203, "name": "anonymous", "sourceLocation": "vscode-file://vscode-app/workspace/vscode-memory-leak-finder/.vscode-test/vscode-linux-x64-1.103.2/resources/app/out/vs/workbench/workbench.desktop.main.js:569:18902", "originalLocation": "src/vs/workbench/contrib/comments/browser/commentsController.ts:715:7", "originalName": "CommentController.beginComputeCommentingRanges" }, { "count": 203, "delta": 203, "name": "anonymous", "sourceLocation": "vscode-file://vscode-app/workspace/vscode-memory-leak-finder/.vscode-test/vscode-linux-x64-1.103.2/resources/app/out/vs/workbench/workbench.desktop.main.js:430:48674", "originalLocation": "src/vs/editor/contrib/folding/browser/folding.ts:344:23", "originalName": "unknown" }, { "count": 203, "delta": 203, "name": "anonymous", "sourceLocation": "vscode-file://vscode-app/workspace/vscode-memory-leak-finder/.vscode-test/vscode-linux-x64-1.103.2/resources/app/out/vs/workbench/workbench.desktop.main.js:527:23529", "originalLocation": "src/vs/workbench/contrib/scm/browser/quickDiffModel.ts:232:10", "originalName": "QuickDiffModel" } ], "isLeak": true }