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
Callbacks lifetime #15
Comments
I'll look into this ASAP, others have been requesting the same thing. It seems nan may have lifted some earlier restriction, since I don't see any serious difficulty in implementing this now. |
Awesome! Thank you! |
Wow, I'm impressed how your bindings are already using nbind quite extensively. I got them working on my development machine and will be testing with callbacks soon. It seems to me they may already work, the callback reference you receive as a parameter will become invalid after the call returns, but you can do:
It's never been tested though, so we'll see. Note that the callback must be called in the same thread where V8 runs or it will crash. Fixing that will require using |
You did an awesome job with nbind 👍
I'll create a separate branch with a failing test that uses nbind callbacks. You can use it to test nbind if you want.
libui run in the javascript thread by default, so this shouldn't be a problem. |
There is a multithread |
I successfully implemented WindowOnClosing before switching to nbind on this commit in libui-node if it could be useful for some reference... |
It's working well, after I save the callback as you suggested... you can see here how I implemented the Thank you! |
Hi, I'm planning on using
nbind
to write libui bindings for node.nbind
will greatly simplify the job, but I will need to use callbacks for UI events...Will this limitations of callbacks usage be removed in near future? There is some known workaround to make them work (as in
setTimeout
usage)?The text was updated successfully, but these errors were encountered: