Closed cptx032 closed 3 years ago
Hi! I'm running the following example:
from cefpython3 import cefpython as cef import sys sys.excepthook = cef.ExceptHook cef.Initialize( None, { "ignore-certificate-errors": "", "disable-gpu": "", }, ) browser = cef.CreateBrowserSync( url="https://google.com", window_title="Title" ) cef.MessageLoop() cef.Shutdown() # Opoening a new window again cef.Initialize( None, { "ignore-certificate-errors": "", "disable-gpu": "", }, ) browser = cef.CreateBrowserSync( url="https://google.com", window_title="Title" ) cef.MessageLoop() cef.Shutdown()
The first browser opens normally, but after I close it manually, the second browser doesn't show up and I get in my terminal: Trace/breakpoint trap (core dumped). The same if I close programatically:
Trace/breakpoint trap (core dumped)
from cefpython3 import cefpython as cef import sys import threading import time sys.excepthook = cef.ExceptHook cef.Initialize( None, { "ignore-certificate-errors": "", "disable-gpu": "", }, ) browser = cef.CreateBrowserSync( url="https://google.com", window_title="Title" ) def close_in_thread(): time.sleep(5) print("SHUTDOWN") cef.Shutdown() threading.Thread(target=close_in_thread).start() cef.MessageLoop() cef.Shutdown() cef.Initialize( None, { "ignore-certificate-errors": "", "disable-gpu": "", }, ) browser = cef.CreateBrowserSync( url="https://google.com", window_title="Title" ) cef.MessageLoop() cef.Shutdown()
Is that the correct way to close the browser, what I'm doing wrong?
You can initialize/shutdown CEF only once during app lifetime.
Ok! Thanks for the reply!
Hi! I'm running the following example:
The first browser opens normally, but after I close it manually, the second browser doesn't show up and I get in my terminal:
Trace/breakpoint trap (core dumped)
. The same if I close programatically:Is that the correct way to close the browser, what I'm doing wrong?