WindowsFormsHost hanging in memory after Dispose

답변됨 WindowsFormsHost hanging in memory after Dispose

  • 2012년 8월 15일 수요일 오후 1:13
     
     

    I've created a WindowsFormsHost to host an ActiveX control, and the WindowsFormsHost still hangs in memory even after I've called Dispose() and removed it from the canvas.  Even if I don't create an ActiveX child, the control stays in memory.  Each time I create one, the old ones hang around even if I force a garbage collection. 

    I ran a utility called "JustTrace", and it says that the WindowsFormsHost is being held by System.Windows.Interop.HwndSourceKeyboardInputSite.  I also tried using reflection to get the underlying winFormsAdapter and using Dispose on that object, but it doesn't help.

    Is there something else that I need to do in order to get the WindowsFormsHost objects cleaned up?

모든 응답