Fix double-free spotted by @mischnic in #402.
This commit is contained in:
parent
b60953ed1c
commit
4eaf01f840
|
@ -66,11 +66,12 @@ void uiImageAppend(uiImage *i, void *pixels, int pixelWidth, int pixelHeight, in
|
||||||
bytesPerRow:pixelStride
|
bytesPerRow:pixelStride
|
||||||
bitsPerPixel:32];
|
bitsPerPixel:32];
|
||||||
repsRGB = [repCalibrated bitmapImageRepByRetaggingWithColorSpace:[NSColorSpace sRGBColorSpace]];
|
repsRGB = [repCalibrated bitmapImageRepByRetaggingWithColorSpace:[NSColorSpace sRGBColorSpace]];
|
||||||
[repCalibrated release];
|
|
||||||
|
|
||||||
[i->i addRepresentation:repsRGB];
|
[i->i addRepresentation:repsRGB];
|
||||||
[repsRGB setSize:i->size];
|
[repsRGB setSize:i->size];
|
||||||
[repsRGB release];
|
// don't release repsRGB; it may be equivalent to repCalibrated
|
||||||
|
// do release repCalibrated though; NSImage has a ref to either it or to repsRGB
|
||||||
|
[repCalibrated release];
|
||||||
|
|
||||||
// we need to keep swizzled alive for NSBitmapImageRep
|
// we need to keep swizzled alive for NSBitmapImageRep
|
||||||
[i->swizzled addObject:[NSValue valueWithPointer:swizzled]];
|
[i->swizzled addObject:[NSValue valueWithPointer:swizzled]];
|
||||||
|
|
Loading…
Reference in New Issue