Re: memory leak

Daniel Luis dos Santos <[email protected]>
Newsgroups gmane.comp.python.pyobjc.devel
Message-ID <[email protected]>
I am using version :

faisca:~ dlsa$ python -c 'import objc; print(objc.__version__)'
2.2b3


On May 12, 2011, at 1:05 PM, Ronald Oussoren wrote:

> 
> On 8 May, 2011, at 19:51, Daniel Luis dos Santos wrote:
> 
>> Hello,
>> 
>> I have some python code in a pyobjc app. At some point I want to initialize a NSString :
>> 
>> 	string = NSString.alloc().init()
> 
> Which version of pyobjc do you use? This works for me:
> 
>>>> from Foundation import NSString
> s = NSString.string>>> s = NSString.string()
>>>> s
> u''
>>>> s = NSString.alloc().init()
>>>> s
> u''
> 
> The PyObjC version can be found using:   python -c 'import objc; print(objc.__version__)'
> 
> Ronald
> 
>> 
>> In the terminal I get the following output :
>> 
>> /Users/dlsa/code/cirrusstore/client/build/cirrusclient.app/Contents/Resources/menubaractions.py:44: UninitializedDeallocWarning: leaking an uninitialized object of type NSPlaceholderString
>> string = NSString.alloc().init()
>> 
>> 
>> I have in my objective C bootstrap code the creation of an Auto release pool.
>> 
>> If I try :
>> 
>> 	string = NSString.alloc().init().autorelease()
>> 
>> I get the same warning.
>> 
>> Why does this happen ?
>> ------------------------------------------------------------------------------
>> WhatsUp Gold - Download Free Network Management Software
>> The most intuitive, comprehensive, and cost-effective network 
>> management toolset available today.  Delivers lowest initial 
>> acquisition cost and overall TCO of any competing solution.
>> http://p.sf.net/sfu/whatsupgold-sd
>> _______________________________________________
>> 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
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.