On Thu, 7 Apr 2022 19:21:31 GMT, Xue-Lei Andrew Fan <xue...@openjdk.org> wrote:

>> Please review the update to remove finalizer method in the 
>> java.security.jgss module. It is one of the efforts to clean up the use of 
>> finalizer method in JDK.
>
> Xue-Lei Andrew Fan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Update copyright year

I see a problem. In `NativeGSSContext`, you only assign `cleanable` for one 
special ctor. In fact, the other 2 ctors (one for initiator and one for 
acceptor) are more useful. `pContext` is initialized to 0 in these 2 ctors and 
it's only assigned inside the native code after the context is established. 
There is no chance to dispose them anymore.

I'm not sure what the best way to do this, but maybe you can put `stub` and 
`pContext` is a separate object and always try to clean it even if `pContext` 
is not assigned at the beginning.

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

PR: https://git.openjdk.java.net/jdk/pull/8136

Reply via email to