Modal dialog and webbrowser control leak

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top