Memory crash updating UIActivityIndicatorView
<p>Whenever I am trying to update the <code>UIActivityIndicatorView</code> from a thread, the app is getting crashed by throwing an exception </p>

<blockquote>
  <p>modifying layer that is being finalized - 0x7e177fd0
  -[CALayer removeAnimationForKey:]: message sent to deallocated instance 0x7e177fd0</p>
</blockquote>

<p>When I try tracking the memory leaks form the mallocDebugger tool, this crash is not happening at all the time happening 1 out of 10 </p>

<p>please help me out from this memory issue </p>

<p>Thread implementation:</p>

<pre><code>NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];

[autoRechargeCell addSubview:activityIndicator];
[self.activityIndicator startAnimating];
if( [PennyTalkAPI getBalanceInfoForAccount:appDelegate.accountNumber withPIN:appDelegate.pinNumber])
{   
    [autoRechargeCell.switchField setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"AutoRecharge"]];
    [self.activityIndicator stopAnimating];   &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; 
}
else
{
    [self.activityIndicator stopAnimating];
}

[pool release]; 
</code></pre>

<p>This is the code I have written.</p>
