Calling class_::referenceexternal "does not take ownership of the C++ pointer", but v8pp still deletes the C++ object when class::destroy is called, which is clearly not intended and leads to crashes due to double deletion.
The "destroy_after" parameter of class_singleton::wrap is only used to determine what callback is given to SetWeak, and isn't stored anywhere in the actual object registry, and so v8pp isn't actually keeping the necessary ownership information everywhere it needs to.
This affects both the shared_ptr branch and the main branch.
I've fixed this issue by marking persistent handles for externally referenced objects as independent,
and do not call destroy function for such objects.
Calling class_::referenceexternal "does not take ownership of the C++ pointer", but v8pp still deletes the C++ object when class::destroy is called, which is clearly not intended and leads to crashes due to double deletion.
The "destroy_after" parameter of class_singleton::wrap is only used to determine what callback is given to SetWeak, and isn't stored anywhere in the actual object registry, and so v8pp isn't actually keeping the necessary ownership information everywhere it needs to.
This affects both the shared_ptr branch and the main branch.