Hi. I started to use cefsharp/41 for my application, but noticed that after some time of work application window hangs (UI thread bloks). When run it from Visual Studio I noticed AccessViolationException (place of exception is not stable, sometimes it occures in mscorlib.dll, sometimes in CefSharp.Core.dll - may be are other places). So I decided to check "pure" CefSharp.WinForms.Example, and also noticed this.
Test environment: VS2013, Windows 7 SP1, En Locale, 64-bit. Inter Core I7-3632QM, 8 GB RAM
Steps to reproduce:
1) Get repo
cd /cygdrive/d/
mkdir cefsh_check
cd cefsh_check/
cd CefSharp/
git checkout cefsharp/41
Head now:
git rev-parse HEAD
6a4b141fca210bd24b970936bd60a929d70ffea3
2) Open cefsh_check/CefSharp/CefSharp3.sln
3) Make CefSharp.WinForms.Example as Startup project and run Debug for test build
4) Put timer on form, set Interval = 500 (0.5 second), Enabled = True and add Tick event:
private void timer1_Tick(object sender, EventArgs e)
{
var rnd = new Random();
if (browserTabControl.TabCount >= 10) {
//dispose some control if count more then 10
var tabPage = browserTabControl.Controls[rnd.Next(browserTabControl.Count];
var control = (BrowserTabUserControl)tabPage.Controls[0];
if (control != null)
{
control.Dispose();
}
browserTabControl.Controls.Remove(tabPage);
}
List<string> sites = new List<string>(new string[] {
"Google.com",
"Facebook.com",
"Youtube.com",
"Baidu.com",
"Yahoo.com",
"Amazon.com",
"Wikipedia.org",
"Qq.com",
"Twitter.com",
"Live.com",
"Taobao.com",
"Linkedin.com",
"Weibo.com",
"Ebay.com"
});
var domain = sites[rnd.Next(sites.Count)];
AddTab(domain);
}
5) Also comment out all InvokeOnUiThreadIfRequired calls in
"public partial class BrowserTabUserControl : UserControl"
- thay all relate only for GUI and have no metter in this test.
But when it uncommented there are sometimes exceptions about inovacation failed.
6) Wait some time until AccessViolationException wil happen (according to my experiments it takes from 10 minutes up to 1 hour, but not shure, may be it depends on other factors).
Can someone confirm such issues? May be you can recommend some stable version of cefsharp/cef without such errors? We can catch most of exceptions but AccessViolationException is real problem.