Re: memory leak

Ronald Oussoren <[email protected]>
Newsgroups gmane.comp.python.pyobjc.devel
Message-ID <[email protected]>
On 12 May, 2011, at 22:47, Daniel Luis dos Santos wrote:

> You are right about not making much sense in using a NSString this way. I did it out of distraction.
> My question is still on. Why the warning ? I just want to understand, because I don't get it.

It's a bug in the copy of PyObjC that's included in OSX 10.6:

$ /usr/bin/python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
:>>> from Foundation import NSString
:>>> NSString.alloc().init()
__main__:1: UninitializedDeallocWarning: leaking an uninitialized object of type NSPlaceholderString
u''
:>>> s = _
:>>> type(s)
<type 'objc.pyobjc_unicode'>
:>>> 

I haven't researched yet why this happens, and later versions work properly.

Ronald

> 
> Regards,
> Daniel Santos
> 
> On May 12, 2011, at 1:14 PM, Greg Ewing wrote:
> 
>> Ronald Oussoren wrote:
>>> I don't know why Daniel wants to use an NSString, but there are reasons to
>>> use NSString instead of Python unicode strings, for example because NSString
>>> has a number of usefull methods with no easy native equivalent.
>> 
>> But is there a reason to use any of them on an *empty* NSString?
>> 
>> -- 
>> Greg
>> 
>> ------------------------------------------------------------------------------
>> Achieve unprecedented app performance and reliability
>> What every C/C++ and Fortran developer should know.
>> Learn how Intel has extended the reach of its next-generation tools
>> to help boost performance applications - inlcuding clusters.
>> http://p.sf.net/sfu/intel-dev2devmay
>> _______________________________________________
>> Pyobjc-dev mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
> 
> 
> ------------------------------------------------------------------------------
> Achieve unprecedented app performance and reliability
> What every C/C++ and Fortran developer should know.
> Learn how Intel has extended the reach of its next-generation tools
> to help boost performance applications - inlcuding clusters.
> http://p.sf.net/sfu/intel-dev2devmay
> _______________________________________________
> Pyobjc-dev mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay

_______________________________________________
Pyobjc-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
smime.p7s (application/pkcs7-signature, 2.2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.