On Mon, 5 Dec 2022 22:01:44 GMT, Phil Race <[email protected]> wrote:

>> Matthias Baesken has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   move freeing into awt_parseColorModel
>
> src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c line 104:
> 
>> 102:                                       cmP)) <= 0) {
>> 103:         awt_freeParsedRaster(&imageP->raster, FALSE);
>> 104:         if (cmP->nBits != NULL) free(cmP->nBits);
> 
> It seems wrong to me that awt_parseColorModel should return a failure code 
> and not have cleaned up any storage it itself allocated.
> In other words this clean up belongs in there.

Hi Phil, I moved the cleanup.

Another question - what do you think about introducting a macro 
JNU_CHECK_EXCEPTION_FREE_RETURN ? We have quite a number of places using this 
pattern (exception check , free and return)  , in this change now as well.  
Might be worth having a macro for this.

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

PR: https://git.openjdk.org/jdk/pull/11508

Reply via email to