From 2e6d52471c32e115f1b77bd097ba420d88cded26 Mon Sep 17 00:00:00 2001 From: Ehsan Date: Fri, 17 Oct 2025 10:40:51 +0200 Subject: [PATCH] Add a clarifying note on value_object docs --- .../docs/porting/connecting_cpp_and_javascript/embind.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/site/source/docs/porting/connecting_cpp_and_javascript/embind.rst b/site/source/docs/porting/connecting_cpp_and_javascript/embind.rst index 55fb4d854e2d4..d481604ee93ae 100644 --- a/site/source/docs/porting/connecting_cpp_and_javascript/embind.rst +++ b/site/source/docs/porting/connecting_cpp_and_javascript/embind.rst @@ -361,6 +361,11 @@ The JavaScript code does not need to worry about lifetime management. var person = Module.findPersonAtLocation([10.2, 156.5]); console.log('Found someone! Their name is ' + person.name + ' and they are ' + person.age + ' years old'); +.. note:: + Fields that correspond to bound C++ objects (such as ``class_``) produce JavaScript + properties that are handles to C++ state. Those properties obey the normal lifetime + rules of their bound type and may require explicit cleanup in JavaScript. + See :ref:`Object Ownership ` for more details. Advanced class concepts =======================