RFR: 8235772: Remove use of deprecated finalize method from PiscesRenderer and AbstractSurface
Ambarish Rapte
arapte at openjdk.java.net
Tue Dec 24 06:37:20 UTC 2019
On Sat, 21 Dec 2019 18:22:44 GMT, Johan Vos <jvos at openjdk.org> wrote:
>> Hi Johan,
>> The `readAndClearMemErrorFlag()` method checks if the variable `mem_Error_Flag` is `JNI_TRUE`.
>> A call should be made to `setMemErrorFlag()` to set `mem_Error_Flag` to `JNI_TRUE`.
>>
>> The methods used to dispose Surface and renderer only `free()` the allocated memory and
>> do not result in making a call to `setMemErrorFlag().`
>> So we do not need to check for `readAndClearMemErrorFlag()`
>> And I think it was not required before this change too.
>
> The dispose methods indeed won't set the `mem_Error_Flag` but this flag might have been set by other methods. Isn't there a probability that the flag has been set, and that `readAndClearMemErrorFlag()` is not yet called since the flag has been set?
Hi Johan, I did miss to verify this angle.
But have checked the code now and can confirm that, in a given function for all possible calls to `setMemErrorFlag()` there exists a call to `readAndClearMemErrorFlag()` in the same function. So it looks safe to remove the memory checks from `dispose()`
-------------
PR: https://git.openjdk.java.net/jfx/pull/66
More information about the openjfx-dev
mailing list