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.
Would you fix the word tuIDhe, I think you mean the?
There was a problem hiding this comment.
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.
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.
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.
Yes, that's why I opened DynamoDS/TuneUp#33. We should publish a new version after we merge that one.
|
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
*.resxfilesReviewers
@QilongTang
FYIs
@mjkkirschner