title: ios: how to solve this memory leak warning
body: <p>I got the following code line:</p>
  
  <pre><code>mainLayer.shadowColor = CGColorCreate( CGColorSpaceCreateDeviceRGB(), components );
  </code></pre>
  
  <p>When I run Product->Analyse in xcode it gives me the warning:</p>
  
  <pre><code>Potential leak of an object allocated on line 176
  </code></pre>
  
  <p>So that means that I do not free my CGColor. Therefore I thought a good solution would be the following:</p>
  
  <pre><code>CGColorRef shadowColor = CGColorCreate( CGColorSpaceCreateDeviceRGB(), components ); 
  mainLayer.shadowColor = shadowColor;
  CGColorRelease( shadowColor );
  </code></pre>
  
  <p>But I still get the same leak warning. How do I repair the problem?</p>