csexton / captured-mac

Captured
http://www.capturedapp.com
MIT License
5 stars 1 forks source link

Fix memory leaks #15

Closed jorgev closed 13 years ago

jorgev commented 13 years ago

Leaks are occurring in the uploaders since there is no auto-release pool for them because they are not on the main thread. These need to be cleaned up.

jorgev commented 13 years ago

This is fixed...we have at least a couple of threads that get created during upload and also for testing connections. So, I set breakpoints in the various places where the leaked objects were being allocated, walked up the stack to the highest point in our code where the threads were being called, and created an autorelease pool at those locations. This eliminated all of the leaks and should work going forward. The only issue is if, somewhere inside these calls, one or more additional threads are created - they will need their own autorelease pool. But I don't see anything like that so I think we're good.

mharper commented 13 years ago

That's exactly how that's handled, Jorge. Nice work!

jorgev commented 13 years ago

Woohoo! Thanks! I'm learning... :)