4
我轉換圖像的NSData到CGImage如下,但我得到的內存泄漏存在,但任何一個可以告訴我如何轉換與出越來越泄漏:如何NSData的轉換圖像到CGImageRef用了內存泄漏
CFDataRef imgData;
CGDataProviderRef imgDataProvider;
CGImageRef image1;
imgData = (CFDataRef)[array objectAtIndex:i];
imgDataProvider = CGDataProviderCreateWithCFData (imgData);
image1 = CGImageCreateWithPNGDataProvider(imgDataProvider, NULL, true, kCGRenderingIntentDefault);
+1。 @laxcha,請閱讀[Core Foundation的內存管理編程指南](https://developer.apple.com/library/mac/#documentation/CoreFOundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html)。 Core Graphics遵循Core Foundation內存管理規則。 –