On Sat, 21 Dec 2019 18:22:44 GMT, Johan Vos <j...@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

Reply via email to