iphone - UIColor leaking... need to release the object?
<p>I have a bunch of lines like this on my app</p>

<pre><code>UIColor *myColor = [UIColor colorWithRed:corR green:corG blue:corB alpha:1.0];
</code></pre>

<p>Instruments are saying these lines are leaking. As this is not formally, as far as I see, an alloc operation (isn't it?) I don't saw the need to release the object, but as instruments are complaining, I added several lines as</p>

<pre><code>[myColor release]
</code></pre>

<p>after using the variable, to please the beast.</p>

<p>Will I have problems doing this, like crashes or something?</p>

<p>Apparently doing this is solving the problem, but I am not comfortable to release an object that was not allocated.</p>

<p>What do you think?</p>

<p>thanks. </p>

<hr>

<h2><strong>E D I T</strong></h2>

<p>I suppose this is a xcode problem or a framework leak.
To prove that I replace the lines with</p>

<pre><code>UIColor *myColor = [[UIColor alloc] initWithRed:corR green:corG blue:corB alpha:1.0];
</code></pre>

<p>and then the object could be safely released... </p>

<p>doing that, solved the problem.</p>
