Skip to content

Commit d154515

Browse files
committed
Add a clarifying note on value_object docs
1 parent bb11bae commit d154515

File tree

1 file changed

+5
-0
lines changed
  • site/source/docs/porting/connecting_cpp_and_javascript

1 file changed

+5
-0
lines changed

site/source/docs/porting/connecting_cpp_and_javascript/embind.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ The JavaScript code does not need to worry about lifetime management.
361361
var person = Module.findPersonAtLocation([10.2, 156.5]);
362362
console.log('Found someone! Their name is ' + person.name + ' and they are ' + person.age + ' years old');
363363
364+
.. note::
365+
It is not recommended to use fields that correspond to regular C++ binding
366+
(such as ``class_<T>``) since those properties will obey the normal lifetime
367+
rules of their bound type and may require explicit cleanup in JavaScript.
368+
See :ref:`Object Ownership <embind-object-ownership>` for more details.
364369

365370
Advanced class concepts
366371
=======================

0 commit comments

Comments
 (0)