On Wed, 29 Oct 2025 11:06:15 GMT, Lukasz Kostyra <[email protected]> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/prism/d3d/D3DTexture.java line 
>> 91:
>> 
>>> 89:     public void update(MediaFrame frame, boolean skipFlush)
>>> 90:     {
>>> 91:         if (!resource.isValid()) {
>> 
>> related - D3DTextureResource line 40 is 
>> 
>> 
>>     public void free() {
>>         if (resource != null) {
>>             resource.dispose();
>>         }
>>     }
>> 
>> 
>> should there be `resource = null;` after `resource.dispose()` ?
>
> It could add another layer of safety and make any potential future NPEs more 
> easy to track - I'll add this.

In looking more closely at the code, it looks like adding `resource = null` in 
`free()` is redundant, since every caller of `free()` already does it right 
after calling it. It doesn't seem harmful, though.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1951#discussion_r2477855994

Reply via email to