-
Notifications
You must be signed in to change notification settings - Fork 604
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
Calling detaching a window when importing a module doesn't work #62
Comments
Same effect can be achieved with the following Python code:
Then |
I get
Apparently a thread that imports a Python module must also hold a special import lock. This of course wreaks havoc when switching threads beneath Python. http://stackoverflow.com/questions/4754319/what-is-import-lock-in-python I think this is a bit too weird of an issue to consider a pybind11/nanogui bug. |
(The solution is to import your module, and to postpone the mainloop call to a method that is invoked following the import.) |
Actually, it seems to also be some weird interaction with IPython. In plain Python, I also get "not holding import lock", but actually everything seems to function fine. In IPython, I don't get the RuntimeError, but I do get the hanging behavior. Python has some weird quirks. But I agree with you, it's not worth considering a pybind11/nanogui bug. |
Not sure what's causing it, but when I try to call
mainloop(detach = ...)
during the initialization of my own module exposed using pybind11, not only does it not detach, but it hangs even after I close the window. Here's an example code:The text was updated successfully, but these errors were encountered: