0

My program has decided to stop terminating when it is done.

The program is spawned by a service, The Main() function calls some external classes I created which make some PDFs and then terminates with a Return. There are no forms, no UI. This has worked for years.

I have now tried End, Application.Exit() and Environment.Exit(0)

I just added some functionality using CefCharp to one of the external classes the program uses and as part of that I have added some Async functions and Awaits to this class. As far as I can tell I am Dispose()ing each instance of the CefSharp browser I am creating. I am also calling CefSharp.Cef.Shutdown() at the end of the same function that calls CefSharp.Cef.Initialize(). All Awaits appear to be returning fine so I don't think I am leaving any threads hanging.

Brad Mathews
  • 1,567
  • 2
  • 23
  • 45

1 Answers1

0

So it turns out that putting CefSharp.Cef.Shutdown() at the end of the same function that initializes it and does most of the work does not seem to be adequate or maybe it is still busy and not ready for shutdown?

So I put another CefSharp.Cef.Shutdown() in my classes' Dispose() method. Now my program terminates properly.

Brad Mathews
  • 1,567
  • 2
  • 23
  • 45