You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the memory management approach of this library? Are the C callbacks freed? Can I free them explicitly? This is important because they might be holding onto e. g. heavyweight objects through capture.
The text was updated successfully, but these errors were encountered:
js::bind creates an std::function object managed by an emscripten::val referring to the onclick function/lambda. emscripten::val is like a shared_ptr between 2 worlds C and JS. It has a reference count and if nobody uses it anymore it gets deleted.
In this case if I change the "onclick" event handler of clickme_btn to something else the previous std::function should get deleted (as soon as JS garbage collection kicks in, as the reference is kept by an object in the JS space).
What is the memory management approach of this library? Are the C callbacks freed? Can I free them explicitly? This is important because they might be holding onto e. g. heavyweight objects through capture.
The text was updated successfully, but these errors were encountered: