Tag: pdfrenderer

CGContextDrawPDFPage内存泄漏 – 应用程序崩溃

当我用仪器分析我的应用程序时,我发现CGContextDrawPDFPage分配的数据不会立即释放。 应用程序因CGContextDrawPDFPage而崩溃。 你好,这里是我在CATiledlayer中绘制pdf的代码 – (void)drawLayer:(CATiledLayer *)layer inContext:(CGContextRef)context { if (_PDFPageRef == nil) { return; } CGPDFPageRef drawPDFPageRef = NULL; CGPDFDocumentRef drawPDFDocRef = NULL; @synchronized(self) // Briefly block main thread { drawPDFDocRef = CGPDFDocumentRetain(_PDFDocRef); if( _PDFPageRef != (__bridge CGPDFPageRef)([NSNull null]) ) drawPDFPageRef = CGPDFPageRetain(_PDFPageRef); else return; } //CGContextSetRGBFillColor(context, 0.0f, 0.0f, 0.0f, 0.0f); //CGContextFillRect(context, CGContextGetClipBoundingBox(context)); if (drawPDFPageRef […]