mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 03:32:37 +00:00
CefSharp.Dom - Don't Dispose DevToolsContext
Disposing of the DevToolsContext is causing problems currently as sending the DevTools protocol messages to the browser is happening after the CefBrowserHost instance has been Disposed. A separate method of disposing of the DevToolsContext will need to be added that does a cleanup without sending the commands. Issue https://github.com/cefsharp/CefSharp.Dom/issues/41
This commit is contained in:
@@ -499,7 +499,7 @@ namespace CefSharp.WinForms
|
||||
ResourceRequestHandlerFactory = null;
|
||||
RenderProcessMessageHandler = null;
|
||||
|
||||
this.DisposeDevToolsContext();
|
||||
this.FreeDevToolsContext();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1796,7 +1796,7 @@ namespace CefSharp
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose of the DevTools Context (if any). Used in conjunction with CefSharp.Puppeteer
|
||||
/// Dispose of the DevToolsContext (if any). Used in conjunction with CefSharp.Dom
|
||||
/// </summary>
|
||||
/// <param name="webBrowserInternal">ChromiumWebBrowser instance</param>
|
||||
public static void DisposeDevToolsContext(this IWebBrowserInternal webBrowserInternal)
|
||||
@@ -1810,6 +1810,20 @@ namespace CefSharp
|
||||
webBrowserInternal.DevToolsContext = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the <see cref="IWebBrowserInternal.DevToolsContext"/> property to null. Used in conjunction with CefSharp.Dom
|
||||
/// </summary>
|
||||
/// <param name="webBrowserInternal">ChromiumWebBrowser instance</param>
|
||||
public static void FreeDevToolsContext(this IWebBrowserInternal webBrowserInternal)
|
||||
{
|
||||
if (webBrowserInternal == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
webBrowserInternal.DevToolsContext = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Function used to encode the params passed to <see cref="ExecuteScriptAsync(IWebBrowser, string, object[])"/>,
|
||||
/// <see cref="EvaluateScriptAsync(IWebBrowser, string, object[])"/> and
|
||||
|
||||
Reference in New Issue
Block a user