Skip to content

Commit 2e6d524

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

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+
Fields that correspond to bound C++ objects (such as ``class_<T>``) produce JavaScript
366+
properties that are handles to C++ state. Those properties 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)