ataranto / CefSharp

.Net binding for the Chromium Embedded Framework
Other
62 stars 34 forks source link

WebView Leaks Memory #28

Closed alittletina closed 12 years ago

alittletina commented 12 years ago

WebView will leak memory whenever a view is removed - the HWND hook is not removed so a reference is kept and the GC will not clean up the view that has the WebView and any linked classes.

A lot of applications switch views and this becomes a big problem over time. Unfortunately I am not familiar with C++ so I cannot fix the code and make a pull request, so I request that you fix it! It is a big problem in my hobby application :(

I suggest that we automatically remove the hook or remove it when IDisposable::Dispose() is called.

Thank you!

ataranto commented 12 years ago

oh, thanks for the heads up. i don't switch views in my app so i've never experienced this. i'll investigate a fix when i have some time to work on CefSharp.

ataranto commented 12 years ago

To be clear, are you using the WinForms or WPF control when you experience this issue?

alittletina commented 12 years ago

Thanks for getting to this!! This occurs when using the WPF WebView.