<div dir="ltr"><div><div><div>Hey guys,<br><br></div>I'm looking at a weird thing going in my project. Wanted to know if you guys know about this or if it's a bug. I've some code like this<br></div><div><br></div>
<div>dispatch_async(dispatch_get_global_queue(Default, 0), ^{<br></div> for (int i = 0; i < 100000; i++) { // a big loop<br></div> [a.b doSomethingWithI:i];<br><div> }<br>});<br><br></div><div>The object "a" uses "forwardInvocation:" to get the property "b" and returns it. Now when I run this I see a huge number of NSInvocation objects being created for the forwardInvocation: never freeing the memory they used although the block is done executing. <br>
<br></div><div>Also this only happens when I run it in Debug build. Moreover this never happens on the main queue. Seems like a bug to me but I might be wrong. Any ideas on what's going on?<br><br><br></div><div>Thanks<br>
Mohit<br></div></div>