Issue on WebView Dispose [ChefSharp 1]

155 views
Skip to first unread message

Tony Mullins

unread,
Feb 13, 2014, 9:25:37 AM2/13/14
to cefs...@googlegroups.com
Hi,

I am using CefSharp 1 with in my windows form application. On Application start (program.cs) I am doing

CEF.Initialize(settings);

and in my form once I have created the webview then on form closing event I am doing

webView.Dispose();

and on application exit I am doing 

CEF.Shutdown();

Now problem is if I try to close the form when webview has not loaded the site completely , my code stuck at webView.Dispose(); and nothing happens and I have to forcefully close the application. And when site is completely loaded then on form closing event same code runs fine , so is there any flag to check when to run webView.Dispose() ?

Thanks for your help & time.
Tony

Per Lundberg

unread,
Feb 17, 2014, 7:29:19 AM2/17/14
to cefs...@googlegroups.com
Hi Tony,

No, you shouldn't have to check if you can run webView.Dispose() or not; we should attempt to fix that on our side, it sounds like the only sensible solution in my eyes. However, as you probably already know, we try to focus as much as possible on CefSharp3 to get it to production quality. That means that CefSharp1 won't get as much love from me as would otherwise be the case.

I think someone (perhaps you? :) should try to dig a bit deeper into the issue and see why the Dispose() method raises an exception before stuff is completely loaded. It probably has to do with the events (CEF or CefSharp) for "page load complete" or similar getting fired *after* stuff has been deallocated. So perhaps it's a matter of making sure all code on the CefSharp side don't access CEF stuff after CEF.Shutdown() has been called or similar.

Feel free to make a GitHub issue out of this, where we can discuss it a bit further. Thanks a lot for your help.

Best regards,
Per
Reply all
Reply to author
Forward
0 new messages