RFR: 8228501: java_props_macosx.c - provide missing CFRelease for CFLocaleCopyCurrent was: RE: java_props_macosx.c : CFLocaleCopyCurrent() needs CFRelease ?

Baesken, Matthias matthias.baesken at sap.com
Tue Jul 23 11:23:48 UTC 2019


Hello,  please review  the following fix  that adds  CFRelease to 2  CFLocaleCopyCurrent usages .

Bug/webrev :

https://bugs.openjdk.java.net/browse/JDK-8228501

http://cr.openjdk.java.net/~mbaesken/webrevs/8228501.0/

Best regards, Matthias


> 
> Thanks for your input !
> 
> I opened
> 
> https://bugs.openjdk.java.net/browse/JDK-8228501
> 
> for this issue, will provide a patch .
> 
> Best regards, Matthias
> 
> 
> > Date: Mon, 22 Jul 2019 12:56:50 -0700
> > From: naoto.sato at oracle.com
> > To: core-libs-dev at openjdk.java.net
> > Subject: Re: java_props_macosx.c : CFLocaleCopyCurrent() needs
> > 	CFRelease ?
> > Message-ID: <72d41e80-82d2-44fc-dead-3fa6a653d6af at oracle.com>
> > Content-Type: text/plain; charset=utf-8; format=flowed
> >
> > Hi Matthias,
> >
> > Thanks for catching them. Yes, I believe they should be released
> > appropriately.
> >
> > Naoto
> >
> > On 7/22/19 4:01 AM, Baesken, Matthias wrote:
> > > Hello  , maybe  someone  with more  OSX dev knowledge could comment
> > on this .
> > > If I understand it correctly ,   the  OSX  Core Foundation Ownership Policy :
> > >
> > >
> >
> https://developer.apple.com/library/archive/documentation/CoreFoundatio
> >
> n/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc
> > /uid/20001148-103029
> > >
> > > says that   "Object-duplication functions that have "Copy" embedded in
> the
> > name."    (like  CFLocaleCopyCurrent )     need  to
> > > relinquish ownership (using
> >
> CFRelease<https://developer.apple.com/documentation/corefoundation/1
> > 521153-cfrelease>) when you have finished with it.
> > >
> > > Should we better add then  CFRelease  to the  2   CFLocaleCopyCurrent
> > usages  in  src/java.base/macosx/native/libjava/java_props_macosx.c
> > (coding below) ?
> > > Or do I miss something ?
> > >



More information about the core-libs-dev mailing list