ShareKit/ShareKit — Issue #69: SHKSharer [self retain] refactoring
Author: VilemKurz
Created: 2011-10-23 17:22:51+00:00
State: open

SHKSharer retains self in share method. There are still paths in the code, when it is not released - leaked. I did some investigation how to approach this problem.

1. approach - do not retain self at the beginning, but "on demand": at the moment of setting self as a delegate in some request methods. Make sure that it is released in the callback. In this case it is ok to retain delegate, similarly as Apple does in NSURLConnection.

2. approach - leave retain at the beginning, but release in the case tryToSend or show method returns NO. This would need to change show method return value from void to bool, and update all implemented sharers.

I think the first approach is more viable. As this will be quite a big and core change, it will need to be tested well. Maybe should be done after 2.0, after everything else is settled down.