fix: 收敛旧模块资源释放与诊断
This commit is contained in:
@@ -185,7 +185,18 @@ namespace Lskj.Main
|
||||
{
|
||||
if (_cefInitialized)
|
||||
{
|
||||
CefRuntime.Shutdown();
|
||||
bool browsersClosed =
|
||||
CefBrowserRuntimeLifetime.CloseAllBrowsersAndWait(5000);
|
||||
if (browsersClosed)
|
||||
{
|
||||
CefRuntime.Shutdown();
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.Instance.WriteLog(
|
||||
"[CEF_LIFECYCLE] CefRuntime.Shutdown skipped " +
|
||||
"because browser close callbacks are incomplete.");
|
||||
}
|
||||
_cefInitialized = false;
|
||||
}
|
||||
_mainProcessInitialized = false;
|
||||
@@ -234,14 +245,18 @@ namespace Lskj.Main
|
||||
commandLine.AppendSwitch("ignore-certificate-errors", "1");
|
||||
commandLine.AppendSwitch("allow-running-insecure-content", "1");
|
||||
|
||||
//如果注册表中CefMultithreading不为1,并且根目录中不存在BrowserMultithreading.txt"文件,就是单线程模式
|
||||
//只要有一个条件满足就是多线程模式
|
||||
if (!BrowserMultithreading() && !File.Exists(PubUtil.AbsolutelyPath + "BrowserMultithreading.txt"))
|
||||
{
|
||||
commandLine.AppendSwitch("single-process", "1");//单线程模式,默认开启。(开启单线程模式后会影响浏览器的性能)
|
||||
}
|
||||
// CEF's single-process switch is unsupported and is unrelated
|
||||
// to MultiThreadedMessageLoop. Keep renderer and utility work
|
||||
// in CEF's normal child processes, as in the official sample.
|
||||
|
||||
commandLine.AppendSwitch("no-proxy-server");
|
||||
// CEF 87 can terminate the host with STATUS_WX86_BREAKPOINT
|
||||
// while creating the first browser on machines whose GPU
|
||||
// driver does not support the legacy compositor path. Keep
|
||||
// software rendering enabled, but bypass GPU initialization.
|
||||
commandLine.AppendSwitch("disable-gpu");
|
||||
commandLine.AppendSwitch("disable-gpu-compositing");
|
||||
commandLine.AppendSwitch("disable-features", "VizDisplayCompositor");
|
||||
commandLine.AppendSwitch("ppapi-flash-version", "99.0.0.999");
|
||||
commandLine.AppendSwitch("ppapi-flash-path", @"PepperFlash\pepflashplayer.dll");
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user