Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxPython 4.0 never calls CefApp.OnInit on Mac #350

Closed
cztomczak opened this issue Apr 18, 2017 · 3 comments
Closed

wxPython 4.0 never calls CefApp.OnInit on Mac #350

cztomczak opened this issue Apr 18, 2017 · 3 comments
Milestone

Comments

@cztomczak
Copy link
Owner

The super(CefApp, self).__init__(redirect=redirect) call never returns and OnInit is never called. This only occurs if cef.Initialize() was called beforehand. There seem to be two solutions:

  1. Initialize CEF after wx was initialized, eg. during a call to embed_browser(). However that results with autorelease error when exiting app.

  2. Implement CefApp.OnPreInit and do wx window creation in that event instead of OnInit.

Issue originally reported on the Forum:
https://groups.google.com/d/topic/cefpython/tM8SXp_a_u0/discussion

cztomczak added a commit that referenced this issue Apr 18, 2017
Fix searching for Python.h include file when building with
system Python 3 on Mac.
@cztomczak
Copy link
Owner Author

Fixed in commit 7c3ffb5. Whether the Solution 2 has any side effects is yet to be discovered.

@andrewleech
Copy link

Works great for me on both:

[wxpython.py] CEF Python 56.1
[wxpython.py] Python 3.6.1 64bit
[wxpython.py] wxPython 4.0.0a1 osx-cocoa (phoenix)

[wxpython.py] CEF Python 56.1
[wxpython.py] Python 2.7.10 64bit
[wxpython.py] wxPython 4.0.0a1 osx-cocoa (phoenix)

Nice solution, Thanks!

@cztomczak cztomczak added this to the v56 milestone Apr 19, 2017
@cztomczak
Copy link
Owner Author

Regarding autorelease pool error, this may be fixed in CEF v59+. Upstream issue for reference: https://bitbucket.org/chromiumembedded/cef/issues/2160/incorrect-use-of-autorelease-pools-in-3071

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants