Modal dialog and webbrowser control leak

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have discovered a leak when using the webbrowser control on a form
displayed as a modal dialog. Navigate has to be called to see the leak.

While viewing Task Manager's Processes tab, it appears to leak a 'USER
Object', 'Handle' and 'Virtual Memory'. While using Spy++, I can see that
it leaves behind an 'Internet Explorer_Hidden' window every time I display
my modal dialog. Calling the form's Dispose method does not help. If I
display the form as modeless, this leak does not occur.

In my Dispose method I can add code that sends an IDCANCEL to all child
windows of the modal dialog and this will close the hidden window and plug
the leak. I'm not sure if this is safe to do though.

Has anyone else run into this problem? Any other safe work arounds?

Thanks,
Jeff Young
Software Engineer
 
Back
Top