Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaks introduced when running against ARC code #8

Open
tiennou opened this issue Jul 31, 2013 · 2 comments
Open

Leaks introduced when running against ARC code #8

tiennou opened this issue Jul 31, 2013 · 2 comments

Comments

@tiennou
Copy link

tiennou commented Jul 31, 2013

I think it's because of Foundation being built with ARC enabled. This makes it so that some objects that weren't going through an autorelease pool now do, causing the NSThread to leak those objects.

malloc_history proof :

ALLOC 0x136429270-0x1364292ff [size=144]: thread_115b04000 |-[VDKQueue
watcherThread:] | -[NSObject(NSObject) autorelease] |
_CFAutoreleasePoolAddObject | CFLog | _CFLogvEx |
_CFStringCreateWithFormatAndArgumentsAux | CFStringCreateCopy |
__CFStringCreateImmutableFunnel3 | _CFRuntimeCreateInstance |
malloc_zone_malloc
----
FREE 0x136429270-0x1364292ff [size=144]: thread_115b04000 |-[VDKQueue
watcherThread:] | -[NSObject(NSObject) autorelease] |
_CFAutoreleasePoolAddObject | CFLog | _CFLogvEx | _CFRelease |
malloc_zone_free
@bdkjones
Copy link
Owner

Yea, you'll want to modify the code to make it Arc-compliant if you use it in that environment.

I'm not a fan of ARC, but I'll try to do this for the repo in the near future.

Sent from my iPhone

On Jul 31, 2013, at 8:00, Etienne Samson [email protected] wrote:

I think it's because of Foundation being built with ARC enabled. This makes it so that some objects that weren't going through an autorelease pool now do, causing the NSThread to leak those objects.

malloc_history proof :

ALLOC 0x136429270-0x1364292ff [size=144]: thread_115b04000 |-[VDKQueue
watcherThread:] | -[NSObject(NSObject) autorelease] |
_CFAutoreleasePoolAddObject | CFLog | _CFLogvEx |
_CFStringCreateWithFormatAndArgumentsAux | CFStringCreateCopy |
__CFStringCreateImmutableFunnel3 | _CFRuntimeCreateInstance |

malloc_zone_malloc

FREE 0x136429270-0x1364292ff [size=144]: thread_115b04000 |-[VDKQueue
watcherThread:] | -[NSObject(NSObject) autorelease] |
_CFAutoreleasePoolAddObject | CFLog | _CFLogvEx | _CFRelease |
malloc_zone_free

Reply to this email directly or view it on GitHub.

@sebikeller
Copy link

look at #11

@tiennou you can checkout from my repo and then recompile using ARC, that should fix the leaks…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants