Skip to content

Multifile diff editor leaks models and editor after closing and hiding #228367

Closed

Description

@werat

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.93.0 (Universal)
  • OS Version: OS: Darwin arm64 23.6.0

Steps to Reproduce:

  1. Make Refactor Preview appear (e.g. open some file and try some of Refactor... context actions)
  2. Close the preview editor via Discard button
  3. Call vscode.window.visibleTextEditors
  4. It contains the vscode-bulkeditpreview-editor://... editor that corresponds to the Refactor Preview we just closed as well as the file that refactor preview was referencing

Repro and demo:

refactor-preview-zombies.mp4

Activity

  1. vs-code-engineering commented on Sep 12, 2024

    @vs-code-engineering
    Contributor

    Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.93.1. Please try upgrading to the latest version and checking whether this issue remains.

    Happy Coding!

  2. werat commented on Sep 12, 2024

    @werat
    ContributorAuthor

    I've just updated and tried it on 1.93.1 -- I can confirm that it still reproduces.

  3. added
    bug
    ux
    on Sep 16, 2024
  4. jrieken commented on Sep 16, 2024

    @jrieken
    Contributor

    Henning Dieterichs (@hediet) it seems that closing the preview editor doesn't reset it, e.g all editors and its models are still around

  5. added
    freeze-slow-crash-leak
    on Sep 16, 2024
  6. changed the title [-]`Refactor Preview` text editors are still reported by `vscode.window.visibleTextEditors` after they're closed[/-] [+]Multifile diff editor leaks models and editor after closing and hiding[/+] on Sep 25, 2024
  7. 27 remaining items

  8. dmitrivMS commented on Sep 28, 2026

    @dmitrivMS
    Collaborator

    Fix is in #228367

  9. added
    unreleased
    on Sep 29, 2026
  10. vs-code-engineering commented on Sep 29, 2026

    @vs-code-engineering
    Contributor

    Sharing media and context from merged PR #333186 for verification:

    Details

    Opening and closing the Source Control multi-diff editor 37 times retained 37 MultiDiffEditorInput instances, 37 view models and SCM sources, and 111 diff items. The shortest retaining path ended at MainThreadEditorTabs._multiDiffEditorInputListeners.

    Change

    Dispose the multi-diff resource listener using the original editor input stored in TabInfo when the tab closes. Add a browser regression assertion that the listener map returns to zero after the open/close event sequence.

    Before

    The multi-diff input graph grew once per iteration. The highlighted rows are fixed by this change; the unrelated DomListener row is intentionally excluded.

    before

    After

    The multi-diff inputs, sources, view models, items, and tab listener callbacks no longer grow. A separate DomListener row remains at the unchanged baseline delta of 69 and is outside this focused fix.

    after

    Test Video

    test-video.webm

    Source PR: #333186

  11. added
    insiders-released
    and removed
    unreleased
    on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugfreeze-slow-crash-leakinsiders-releaseduxverifiedworkspace-edit

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions