title: CGContextRelease(); doesn't release the context?
body: <p>I've got a nice and short method to load textures in my iPhone app, where I <code>glGenTextures(13, &amp;textures[0]);</code>. Of course at the end of it I do <code>glDeleteTextures(13, textures);</code>, but the memory isn't fully released untill I comment out this line: 
  <code>CGContextDrawImage(textureContext, CGRectMake(0.0, 0.0, (float)texWidth, (float)texHeight), textureImage);'</code> (which of course results in having the textures totally black) although the next line says:</p>
  
  <pre><code> CGContextRelease(textureContext);
  </code></pre>
  
  <p>This is the full code for loading the textures:</p>
  
  <pre><code>- (void)loadTexture:(NSString *)name intoLocation:(GLuint)location {
      CGImageRef textureImage = [UIImage imageNamed:name].CGImage;
      if (textureImage == nil) {
          NSLog(@"Failed to load texture image");
          return;
      }
  
      NSInteger texWidth = CGImageGetWidth(textureImage);
      NSInteger texHeight = CGImageGetHeight(textureImage);
  
      GLubyte *textureData = (GLubyte *)malloc(texWidth * texHeight &lt;&lt; 2);
  
      int k, l = texWidth * texHeight &lt;&lt; 2;
      for (k=0; k&lt;l; k++) textureData[k] = 0;
  
      CGContextRef textureContext = CGBitmapContextCreate(textureData, texWidth, texHeight, 8, texWidth &lt;&lt; 2, CGImageGetColorSpace(textureImage),
                                                          kCGImageAlphaPremultipliedLast);
      CGContextTranslateCTM(textureContext, 0, texHeight);
      CGContextScaleCTM(textureContext, 1.0, -1.0);
      CGContextDrawImage(textureContext, CGRectMake(0.0, 0.0, (float)texWidth, (float)texHeight), textureImage);
      CGContextRelease(textureContext);
  
      glBindTexture(GL_TEXTURE_2D, location);
      glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
      glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
      glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texWidth, texHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureData);
  
      free(textureData);
      glEnable(GL_TEXTURE_2D);
  }
  </code></pre>