On Thu, 28 Sep 2023 11:58:23 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:

> > Hmmm okay - it seems fragile to have a psuedo-destructor in release().
> 
> I don't know what this comment means.

Object lifetimes should be well managed such that you can't use an object after 
it has been "destroyed". Methods like `release()` effectively nuke the 
internals of the object but the object is still available to be (mis)used. 
Before this fix `release` left a dangling `_obj` pointer, but that wouldn't be 
an issue if the handle itself could not be used after being released.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15920#issuecomment-1740244084

Reply via email to