make sure that SymbolReader.Dispose closes all opened pdb files #979
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.
I've recently profiled an app using PerfView, opened the trace file, used
Goto Source (Def)
, closed the Source Window, modified the app source code and tried to rebuild the app.The rebuild has failed with file in use exception:
This PR helps with that by making sure that when the
SymbolReader.Dispose
is called, it closes all the opened pdb files.It's still not a perfect solution because
SymbolReader.Dispose
is called on the static symbol reader instance only when a new trace file is opened:perfview/src/PerfView/PerfViewData.cs
Line 3887 in 96321f1
perfview/src/PerfView/App.cs
Line 821 in 1a14779
So closing the Source Code window still keeps the .pdf file opened but opening another trace file closes it. A better solution would require much more changes related to symbol reader cache lifetime management but I don't think that it's worth it as of today.