Re: Mixing Cpp and ObjC - Memory Leak in ARC
Re: Mixing Cpp and ObjC - Memory Leak in ARC
- Subject: Re: Mixing Cpp and ObjC - Memory Leak in ARC
- From: Jean-Daniel <email@hidden>
- Date: Sun, 04 Dec 2016 14:52:41 +0100
> Le 4 déc. 2016 à 11:51, Hado Hein Applelists <email@hidden> a écrit :
>
>
>> On 28.11.2016, at 19:02, Quincey Morris <email@hidden> wrote:
>>
>> On Nov 28, 2016, at 04:26 , Hado Hein Applelists <email@hidden> wrote:
>>>
>>> Instruments unfortunately finds no leaks.
>>
>> Yes, but that’s not really important. A “leak” in the Instruments sense likely means an object kept alive by a reference cycle, but there are other situations of objects being undesirably being kept alive for other reasons. You should use the Allocations instrument, along with “generation” marking to watch for unexpected growth in the numbers of specific objects.
>>
>> I wouldn’t assume that the problem is in the handling of the NSColor objects themselves.
>>
>
> It looks like.
> Instruments measures growing amounts of allocations NSColorSpace (not a NSColor).
> And it looks like that the old value of the property does not get deallocated or still has a reference count in the cpp callback where it was alloced.
>
> I tried different settings for the property but results are always the same and as expected. (assign crashes, copy and retain work but mem usage grows)
For each object, Instrument records each retain/release/alloc/dealloc call with stack trace.
You can easily find where the color space is allocated, where it is retained, and why the retain count never goes down to 0 by inspecting these records.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden