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: Jens Alfke <email@hidden>
- Date: Sun, 27 Nov 2016 14:54:48 -0800
On Nov 27, 2016, at 8:40 AM, Hado Hein Applelists < email@hidden> wrote:
Unfortunately, when I turn on Malloc Debug Functions in Xcode the thing does not compile anymore.
I’m not sure what you mean by this; there isn’t anything with that exact name. Do you mean the Address Sanitizer? That’s the only related option that affects compilation.
In any case you don’t need to use the Address Sanitizer to use Instruments’ leak detector. (In fact I’m not sure the two are even compatible.) I assume that this might have to do something with using a Foundation constructor In cpp code which doesn’t arc correctly.
I have a lot of Objective-C++ code that calls and is called by pure C++, and it works fine with ARC.
No. I tried some autoreleasepools and it is still leaking.
Can you show the code that you tried? It’s important to wrap the autorelease pool around all the code that calls Obj-C methods, not just places where you directly allocate objects, because anything you call might indirectly allocate objects.
—Jens |
_______________________________________________
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