开发者

Finding leaks under GeneralBlock-16?

开发者 https://www.devze.com 2022-12-19 23:55 出处:网络
If ObjectAlloc cannot deduce type information for the block, it uses \'GeneralBlock\'. Any strategies to get leaks from this block that may eliminate the need of my \'trial and error\' me开发者_运维技

If ObjectAlloc cannot deduce type information for the block, it uses 'GeneralBlock'. Any strategies to get leaks from this block that may eliminate the need of my 'trial and error' me开发者_运维技巧thods that I use? The Extended Detail thing doesn't really do it for me as I just keep guessing.


I find that sometimes if in the leaks instrument you click the button that looks something like this: {= and drag your app delegate file onto the screen, it will lead you in the right direction by highlighting the code that allocated that leaked block.

Every time it goes into a function call drag the source file with that function onto it. This can be hit and miss though as sometimes these mystery leaks aren't tracked back to the delegate.


In XCode, you can try build and analyze. Sometimes it can be helpful in finding leaks and sometimes not. But it's worth a shot.


I've just started using objective-c and xcode (version 4) and it appears that by clicking on the leaked object in the memory profiler, you can see exactly the point in the code it is referring to in the "extended detail" pane. In here it shows you a stack trace and clicking on a point in the stack will take you to the exact point in the code where the leak is occuring. Not sure if this was available in v3. Hope this helps anyone else tracking down a leaky GeneralBlock-16.

0

精彩评论

暂无评论...
验证码 换一张
取 消