Embind and destructors - docs are unclear

18 views
Skip to first unread message

שחר לנגבהיים

unread,
Oct 29, 2019, 9:08:49 AM10/29/19
to emscripten-discuss
Hi,
I'm trying to understand how to embind the various types I want to expose to JS, and if I understand it correctly, the embind documentation seems incomplete. 
The docs state that JS cannot call destructors automatically, and then suggests this code:
var x = new Module.MyClass;
x.method();
x.delete();
  1. Does this mean that all objects defined with class_ have a built-in JS method called delete, that calls their destructor? 
  2. If so, is this the same for already available types, such as smart pointers and vectors? If not, how do I dispose of smart pointers and vectors?
  3. How are raw pointers freed? The code examples 
  4. How do value types play with smart pointers and vectors? Can they be contained? 
  5. Can a value_object be an element in a value_array? Can a value_array be a field in a value_object? 
  6. Can either value types be used as members of a class_?
Reply all
Reply to author
Forward
0 new messages