Skip to content

Conversation

@aestuans
Copy link

The sentence "The JavaScript code does not need to worry about lifetime management" could be misleading on its own.

@kripken kripken requested a review from brendandahl October 21, 2025 16:59
@aestuans
Copy link
Author

@brendandahl just a ping, in case this got lost in your notifications.

Copy link
Collaborator

@brendandahl brendandahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably take this a bit further and say it's not recommended to mix the two types of bindings, since value bindings are really meant for making bindings where you don't need to worry about memory management. Something like:

.. note::
    It is not recommended to use fields that correspond to regular C++ binding
    (such as ``class_<T>``) since those properties obey the normal lifetime
    rules of their bound type and may require explicit cleanup in JavaScript.
    See :ref:`Object Ownership <embind-object-ownership>` for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants