-
Notifications
You must be signed in to change notification settings - Fork 635
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
Make sure extension window closes with Dynamo #10557
Conversation
View extensions that add a Window to the extension bar, run the risk of leaving a window open when Dynamo closes, resulting in a zombie process . The extension could avoid the problem in either of these two ways: 1. Setting the Owner property of the Window they create to the one obtained from ViewLoadedParam.DynamoWindow. 2. Calling the Close method on the Window they created when the Shutdown life-time method is called on the extension. However, Dynamo should not rely on view extensions doing this. In order to be able to still close no matter what, we assign the Owner property explicitly in DynamoView.AddExtensionTabItem.
}; | ||
if (SetOwner) | ||
{ | ||
// Set the owner of the window to tuIDhe Dynamo window. |
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.
Would you fix the word tuIDhe
, I think you mean the
?
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.
That's not mine, so I'll probably remove it :)
if (extensionWindow != null) | ||
{ | ||
// Make sure the extension window closes with Dynamo | ||
extensionWindow.Owner = this; |
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.
Interesting.. I start to think this maybe why the fix did not work for me because when I tried it, I was calling close() specifically for Tuneup while your code should work for both TuneUp and NodePropertyPalette.
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.
However, giving this more thoughts. I think this approach is excellent that Dynamo should handle it properly. We may still want to release a version of Tuneup which contain a close() call so that current users who are using Tuneup can be saved.
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.
Yes, that's why I opened DynamoDS/TuneUp#33. We should publish a new version after we merge that one.
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.
@mmisol Gotcha
LGTM. Let's fix the comments and merge |
Purpose
View extensions that add a Window to the extension bar, run the risk of
leaving a window open when Dynamo closes, resulting in a zombie process
. The extension could avoid the problem in either of these two ways:
Setting the Owner property of the Window they create to the one
obtained from ViewLoadedParam.DynamoWindow.
Calling the Close method on the Window they created when the
Shutdown life-time method is called on the extension.
However, Dynamo should not rely on view extensions doing this. In order
to be able to still close no matter what, we assign the Owner property
explicitly in DynamoView.AddExtensionTabItem.
Declarations
Check these if you believe they are true
*.resx
filesReviewers
@QilongTang
FYIs
@mjkkirschner