i tested the merged code again and got access violations in ManagedCefAdapter.Dispose because it was called after Cef.Terminate so i added some more cleanup insanity

This commit is contained in:
JanEggers
2014-05-15 19:51:53 +02:00
parent 295f770714
commit d2ebda89d1
+8
View File
@@ -40,6 +40,7 @@ namespace CefSharp.Wpf
private Popup popup;
private ScaleTransform dpiTransform;
private readonly List<IDisposable> disposables = new List<IDisposable>();
private static readonly List<WebView> webViews = new List<WebView>();
public BrowserSettings BrowserSettings { get; set; }
public bool IsBrowserInitialized { get; private set; }
@@ -265,6 +266,8 @@ namespace CefSharp.Wpf
{
disposable.Dispose();
}
webViews.Remove(this);
}
#endregion CleanupElement dependency property
@@ -316,6 +319,7 @@ namespace CefSharp.Wpf
public WebView()
{
webViews.Add(this);
Focusable = true;
FocusVisualStyle = null;
IsTabStop = true;
@@ -405,6 +409,10 @@ namespace CefSharp.Wpf
// control should not explicitly have to perform this.
if (Cef.IsInitialized)
{
foreach (var webView in webViews.ToList())
{
webView.Cleanup();
}
GC.Collect();
GC.WaitForPendingFinalizers();