-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: No more spurious restart needed in the IDE #4834
Conversation
@@ -345,7 +346,7 @@ public class ProjectManager : IDisposable { | |||
} | |||
|
|||
public void OpenDocument(Uri uri, bool triggerCompilation) { | |||
Interlocked.Increment(ref openFileCount); | |||
openFiles.TryAdd(uri, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What role does the 1
serve here? Could this be a set instead of a map?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only concurrent set I found in C# is a ConcurrentBag but it curiously does not have a method for removing a specific element.
Amazing, thanks :) @MikaelMayer I'm a little concerned that we didn't get to understand how you got the stack trace:
But then again I wouldn't think the exception from this stack trace causes an issue, because it relates to already closed project managers, so we can leave it for now |
I got this exception while putting breakpoints on disposed method, which apparently was caught here:
|
Fixes #4833
Description
I replaced the openFileCount by openFiles so that closing a document, even if unexpected like VSCode does randomly, won't trigger the Compilation object to be disposed, which crashes the IDE every 3-4 minutes on projects with multiple files open.
How has this been tested?
I have been enjoying the IDE for 20 minutes straight without restarting it. It's a fantastic experience. I'm going to turn on "verification on change" again.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.