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

PyQt example crashes when closing window #30

Closed
GoogleCodeExporter opened this issue Mar 22, 2015 · 6 comments
Closed

PyQt example crashes when closing window #30

GoogleCodeExporter opened this issue Mar 22, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.python pyqt4.py
2.Click the close button
3.

What is the expected output? What do you see instead?
Expected is no output, instead I get this on the console.
[1127/084154]:ERROR_REPORT:browser_impl.h(181)] Check failed: 
CefThread::CurrentlyOn(CefThread::UI).

What version of the product are you using? On what operating system?
cefpython 0.45

Please provide any additional information below.
Curiously, this issue appears on my system but on another system it works 
without a problem.


Original issue reported on code.google.com by codeprop...@gmail.com on 27 Nov 2012 at 2:47

@GoogleCodeExporter
Copy link
Author

There is a topic on CEF forum regarding this matter:
http://magpcss.org/ceforum/viewtopic.php?f=6&t=10252

I'm not sure how threads in Qt work.

Original comment by czarek.t...@gmail.com on 27 Nov 2012 at 2:56

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Original comment by czarek.t...@gmail.com on 27 Nov 2012 at 3:06

  • Changed title: PyQt example crashes when closing window

@GoogleCodeExporter
Copy link
Author

Fixed in revision 2469d5441fd3.

The solution was to assign None to QApplication before calling shutdown:

  app = None
  cefpython.Shutdown()

This fix removed errors in the console, I'm assuming it also fixed the crash, 
but as I couldn't reproduce it, I'm not 100% sure, so better test it.

Original comment by czarek.t...@gmail.com on 27 Nov 2012 at 9:46

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Verified. Issue disappears if None is assigned to app. App must be garbage 
collected by null assignment but not sure how/why it was causing the error in 
first place.

Original comment by codeprop...@gmail.com on 27 Nov 2012 at 11:34

@GoogleCodeExporter
Copy link
Author

I guess Qt could still run some internal threads that collided with shutdown or 
something. It makes sense, we called cefpython.Initialize() before QApplication 
was initialized, so we should destroy QApplication (it also needs to do some 
cleanup, probably called in destructor) before cefpython.shutdown().

Original comment by czarek.t...@gmail.com on 28 Nov 2012 at 12:39

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

1 participant