feat(ios): Optimize invertColors / fix memory leak (#2955)
Releases the CGImage that was created in order to populate the UIImage's CGImage property. This probably relates to #2904 and possibly #2950.
This commit is contained in:
parent
90ec544cd2
commit
43f2a0f774
@ -126,10 +126,13 @@
|
||||
|
||||
// A UIImage initialized directly from CIImage has its CGImage property set to NULL. So it has
|
||||
// to be converted to a CGImage first.
|
||||
CIContext *context = [CIContext context];
|
||||
static CIContext *context = nil; if (!context) context = [CIContext contextWithOptions:nil];
|
||||
CGImageRef outputCGImage = [context createCGImage:outputCIImage fromRect:[outputCIImage extent]];
|
||||
|
||||
UIImage *outputUIImage = [UIImage imageWithCGImage:outputCGImage];
|
||||
|
||||
CGImageRelease(outputCGImage);
|
||||
|
||||
return outputUIImage;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user