My Window will not be garbage collected if it has a child of type FormulaEditorDialog.
For a simplified example call the following two event handlers on buttons of any dialog.
WeakReference _WeakRef = null;
private void OnCheck(object sender, RoutedEventArgs e)
{
GC.Collect();
GC.WaitForPendingFinalizers();
if(_WeakRef.IsAlive)
throw new Exception("Window alive!");
}
private void OnDialog(object sender, RoutedEventArgs e)
Window dlg = new Window();
dlg.Content = new FormulaEditorDialog(); // with this line dlg lives forever
_WeakRef = new WeakReference(dlg);
if(dlg.ShowDialog() == true)
The window will stay alive, if it has content of type FormulaEditorDialog.
Do you have any workaround or solution for this problem?
TIA
Michael
Hello Michael,
Thank you for your post.
I have been looking into it, but it seems like I am missing something from your scenario, so if this is still an issue for you, could you please send me, an isolated sample project, where this is reproduced, so I can investigate it further for you.
Looking forward to hearing from you.
I have attached a small sample demonstrating the Problem.
The development issue with ID of 217549 has been fixed and it is available in the latest Service Release. You can download the Service Release by logging in our web site and then going to Account\My Keys and Downloads page.
Thank you for using Infragistics Components.
Sincerely,ZhivkoDeveloper Support Engineer
I have logged this behavior with our developers in our tracking system, with an issue ID 217549. I have also created a support ticket on your behalf with number CAS-171670-C8G2T6 in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.