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
If I try adding a std::function to a v8pp module, and then force a final garbage collection before disposing of the isolate (which generally appears to be necessary if you're worried about making sure all embedded C++ objects get garbage collected, since merely disposing of the isolate doesn't guarantee all the weak callbacks v8pp registers are actually called), I get an assertion failure ("Check failed: node_->state() == Node::FREE.") later when trying to actually disposing of the isolate.
This doesn't happen (i.e., no assertion failure triggers) if I add either a C++ function or a lambda to the module instead of a std::function.
Test program illustrating the crash attached: v8_gc_crash.txt
The text was updated successfully, but these errors were encountered:
…30)
Added `external_data<T>` template class to store user data of type T when
sizeof(T) > sizeof(void*) and weak handle to v8::External with value pointing
to such an external_data instance.
User data are stored in std::aligned_storage<sizeof T> data member of
external_data instance and being deleted in the weak handle callback.
Updated function, module, class, and property wrappers to accept universal
references to binding entities to avoid making of unnecessary copies.
@scottd72, I've changed internal data storage for wrapped C++ callable objects with sizeof greater than sizeof pointer (e.g. lambdas with captured values, std::function objects, user-defined classes with operator() ) and it seems has fixed this issue.
At least I hope so, since my tests and your program works now without assertion failures.
If I try adding a std::function to a v8pp module, and then force a final garbage collection before disposing of the isolate (which generally appears to be necessary if you're worried about making sure all embedded C++ objects get garbage collected, since merely disposing of the isolate doesn't guarantee all the weak callbacks v8pp registers are actually called), I get an assertion failure ("Check failed: node_->state() == Node::FREE.") later when trying to actually disposing of the isolate.
This doesn't happen (i.e., no assertion failure triggers) if I add either a C++ function or a lambda to the module instead of a std::function.
Test program illustrating the crash attached: v8_gc_crash.txt
The text was updated successfully, but these errors were encountered: