关于CefSharp.Cef.Shutdown主窗口一起退出问题

zj_zwl 2017-09-11 09:08:14
当调用CefSharp.Cef.Shutdown方法时,我的主窗口一起被关闭了!
我的要求是调用CefSharp.Cef.Shutdown方法,清理掉浏览器占用的资源,但不关闭主窗口.
有同仁研究过吗?
...全文
2331 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zj_zwl 2018-02-22
  • 打赏
  • 举报
回复
引用 6 楼 z386386 的回复:
我也碰到了。 System.Diagnostics.Process.GetCurrentProcess().Kill(); 这个可以解决
杀了当前进程,那主窗口不会退出?
z386386 2018-02-22
  • 打赏
  • 举报
回复
我也碰到了。 System.Diagnostics.Process.GetCurrentProcess().Kill(); 这个可以解决
zj_zwl 2018-02-08
  • 打赏
  • 举报
回复
没解决.............
tangyong12 2018-02-08
  • 打赏
  • 举报
回复
请问解决了吗?我也碰到类似的问题,shutdown后必须把主进程也退出才能释放资源,否则重新初始化会自动退出
TearyWang 2017-09-12
  • 打赏
  • 举报
回复
Shuts down CefSharp and the underlying CEF infrastructure. This method is safe to call multiple times; it will only shut down CEF on the first call (all subsequent calls will be ignored). This method should be called on the main application thread to shut down the CEF browser process before the application exits. If you are Using CefSharp.OffScreen then you must call this explicitly before your application exits or it will hang. This method must be called on the same thread as Initialize. If you don't call Shutdown explicitly then CefSharp.Wpf and CefSharp.WinForms versions will do their best to call Shutdown for you, if your application is having trouble closing then call thus explicitly.
zj_zwl 2017-09-12
  • 打赏
  • 举报
回复
引用 2 楼 homesos 的回复:
[quote=引用 楼主 zj_zwl 的回复:] 当调用CefSharp.Cef.Shutdown方法时,我的主窗口一起被关闭了! 我的要求是调用CefSharp.Cef.Shutdown方法,清理掉浏览器占用的资源,但不关闭主窗口. 有同仁研究过吗?
调这个方法的时机不对,资源很紧张吗?个人觉得没有必要吧?省资源要用其他办法。[/quote] 不是为节约资源,只是想实现关浏览器的同时主程序不退出
homesos 2017-09-12
  • 打赏
  • 举报
回复
引用 楼主 zj_zwl 的回复:
当调用CefSharp.Cef.Shutdown方法时,我的主窗口一起被关闭了! 我的要求是调用CefSharp.Cef.Shutdown方法,清理掉浏览器占用的资源,但不关闭主窗口. 有同仁研究过吗?
调这个方法的时机不对,资源很紧张吗?个人觉得没有必要吧?省资源要用其他办法。

111,094

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧