Skip to content

Fix crash when closing PMUI ToolWindow preventing tab closure. - #3423

Merged
mirkomuggli merged 1 commit into
dev-feature-OE.PMUIfrom
dev-mirkomug-tabclose
Jun 24, 2020
Merged

mirkomuggli merged 1 commit into
dev-feature-OE.PMUIfrom
dev-mirkomug-tabclose

Conversation

@mirkomuggli

Copy link
Copy Markdown

Bug

Fixes: 9626
Regression: No

Fix

Changed Dispose logic to dispose the ToolWindow during OnClose, instead of immediately after creating the object.

Testing/Validation

Tests Added: No
Reason for not adding tests: Basic functionality, not something that'll change once it's working.
Validation: It's working now :)

@donnie-msft donnie-msft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nonblocking comments..


[assembly: SuppressMessage("Build", "CA1307:The behavior of 'string.Equals(string)' could vary based on the current user's locale settings. Replace this call in 'NuGet.VisualStudio.OnlineEnvironment.Client.NuGetWorkspaceCommandHandler.IsSolutionOnlySelection(System.Collections.Generic.List<Microsoft.VisualStudio.Workspace.VSIntegration.UI.WorkspaceVisualNodeBase>)' with a call to 'string.Equals(string, System.StringComparison)'.", Justification = "<Pending>", Scope = "member", Target = "~M:NuGet.VisualStudio.OnlineEnvironment.Client.NuGetWorkspaceCommandHandler.IsSolutionOnlySelection(System.Collections.Generic.List{Microsoft.VisualStudio.Workspace.VSIntegration.UI.WorkspaceVisualNodeBase})~System.Boolean")]
[assembly: SuppressMessage("Build", "CA1031:Modify 'RunSolutionRestoreAsync' to catch a more specific allowed exception type, or rethrow the exception.", Justification = "<Pending>", Scope = "member", Target = "~M:NuGet.VisualStudio.OnlineEnvironment.Client.RestoreCommandHandler.RunSolutionRestoreAsync~System.Threading.Tasks.Task")]
[assembly: SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "<Pending>", Scope = "member", Target = "~M:NuGet.VisualStudio.OnlineEnvironment.Client.PackageManagerUICommandHandler.CreateToolWindowAsync(System.String,System.String,Microsoft.VisualStudio.Shell.Interop.IVsHierarchy,System.UInt32)~System.Threading.Tasks.Task{Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame}")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a note for the Justification

0, // dwToolWindowId - singleInstance = 0
windowPane, // ToolWindowPane
Guid.Empty, // rclsidTool = GUID_NULL
Guid.NewGuid(), // TODO: should be projectGuid...so persistance info works.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking issue for TODO

{
if (windowPane != null)
{
windowPane.Dispose();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the cause of the Suppression for not disposing? If so, should that be global or should it be just on this method?

@mirkomuggli mirkomuggli Jun 1, 2020 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either works, really. I put this here because I was asked to put the last suppression I had to add into the global file :)

@sbanni
sbanni force-pushed the dev-feature-OE.PMUI branch 2 times, most recently from d92f8a4 to a0a5e5c Compare June 9, 2020 18:10
@zivkan

zivkan commented Jun 14, 2020

Copy link
Copy Markdown
Member

@mirkomuggli please rebase this branch, or close if this PR is no longer needed.

@rrelyea

rrelyea commented Jun 16, 2020

Copy link
Copy Markdown
Contributor

this PR has 7 commits in it. Are some of those already merged into feature branch?

@mirkomuggli
mirkomuggli force-pushed the dev-mirkomug-tabclose branch 3 times, most recently from 03ce43e to 4a5581b Compare June 16, 2020 21:08
@sbanni
sbanni force-pushed the dev-feature-OE.PMUI branch from a0a5e5c to db13dc6 Compare June 23, 2020 16:59
@mirkomuggli
mirkomuggli force-pushed the dev-mirkomug-tabclose branch from 4a5581b to 0fcaee1 Compare June 23, 2020 17:10
@sbanni
sbanni force-pushed the dev-feature-OE.PMUI branch from db13dc6 to 35e1804 Compare June 24, 2020 20:30
@mirkomuggli
mirkomuggli force-pushed the dev-mirkomug-tabclose branch 3 times, most recently from baf5281 to bcac32a Compare June 24, 2020 21:28
@mirkomuggli
mirkomuggli deleted the dev-mirkomug-tabclose branch June 24, 2020 21:44
@mirkomuggli
mirkomuggli restored the dev-mirkomug-tabclose branch June 24, 2020 21:45
@mirkomuggli mirkomuggli reopened this Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants