File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
CefSharp.OffScreen.Example Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ public static int Main(string[] args)
2222 Console . WriteLine ( "You may see a lot of Chromium debugging output, please wait..." ) ;
2323 Console . WriteLine ( ) ;
2424
25+ Cef . EnableWaitForBrowsersToClose ( ) ;
26+
2527 // You need to replace this with your own call to Cef.Initialize();
2628 CefExample . Init ( new CefSettings ( ) , browserProcessHandler : new BrowserProcessHandler ( ) ) ;
2729
@@ -34,6 +36,11 @@ public static int Main(string[] args)
3436 // We have to wait for something, otherwise the process will exit too soon.
3537 Console . ReadKey ( ) ;
3638
39+ //Wait until the browser has finished closing (which by default happens on a different thread).
40+ //Cef.EnableWaitForBrowsersToClose(); must be called before Cef.Initialize to enable this feature
41+ //See https://github.com/cefsharp/CefSharp/issues/3047 for details
42+ Cef . WaitForBrowsersToClose ( ) ;
43+
3744 // Clean up Chromium objects. You need to call this in your application otherwise
3845 // you will get a crash when closing.
3946 Cef . Shutdown ( ) ;
You can’t perform that action at this time.
0 commit comments