How can I call Cef.Shutdown from OnLoadingStateChanged()?

0

I'm forcing with Cef Sharp problem which I cannot resolve. My browser executes some code, then the function OnLoadingStateChanged checks for some condition. If condition is true then browser and all whole program should be end. The problem is that the browser instance run on thread (threadid 6) and my Cef.Initialize was call from thread (managedthreadid 1). How can I execute my method which close cef sharp on ManagedThreadID 1? Getting thread ID is possible in that case. Is it possible to call method on given thread when I know thread's id?

  HResult=0x80131500
  Message=Cef.Shutdown must be called on the same thread that Cef.Initialize was called - typically your UI thread. If you called Cef.Initialize on a Thread other than the UI thread then you will need to call Cef.Shutdown on the same thread. Cef.Initialize was called on ManagedThreadId: 1where Cef.Shutdown is being called on ManagedThreadId: 6

Thank You in advice ! :)

c#
multithreading
cefsharp
chromium-embedded
asked on Stack Overflow Sep 8, 2020 by Hawos

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0