Dispose extension files in EditorAppExtended #680
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.
Fixes #679
There was a bug where disposing and then reinitializing an
EditorAppExtended
where an extension hasfilesOrContents
would result in an exception being thrown due to not disposing these files from the last time the extension was registered. This fixes that by disposing of the results ofregisterFileUrl
in thedisposeApp
method.I added a test to exercise this; the test introduced in the first commit exhibits the
Error: file 'extension-file://undefined.undefined/' already exists
error, and that error goes away in the second commit. Unfortunately, when I run this test suite, I also get a bunch of "Array buffer allocation failed" errors that seem to come from somewhere in VSCode's services. I tried using theupdateExtendedAppPrototyp
test helper to fix this, but that seems to remove so much functionality that the original "file already exists" error no longer happens in the first place. Open to suggestions on how to fix the test, or I can just remove the test so we can ship the fix.