Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Cleaning up WindowsFormsHost in a WPF dialog

$
0
0

Hi, I have a windows forms project, where I use a number WPF dialogs (ie a window which I call ShowDialog()). One in particular has a WindowsFormsHost control (to host a windows forms control)

I am using Dev studio 2010, and .net 4.0.

I have been tracking memory leaks (using a 3rd party tool), and have noticed that my WPF dialog is being held in memory! It appears to be something to be with an event handler "ProcessInputEventHandler" of the WindowFormsHost that has has not been removed (see below is a diagram I get from my memory tracking tool).

 

I have tried calling Dispose on the WindowFormsHost control, as well as the control it contains (MaskedTextBox), but it did not fix anything. Has anyone else come across this, and know of any solution?

 

Thanks in advance for any help.

regards

Peter

 



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>