From d154515ef068b8c73eb78c69c61cc398060168d5 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..ade279130f4e2 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:: + It is not recommended to use fields that correspond to regular C++ binding + (such as ``class_``) since those properties will 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 =======================