Cocoa: fix coretext memory leaks

Change-Id: Id85dbf8a2ea8994d9fca07d3f10b43f62ec305a0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Teemu Katajisto 2012-10-18 11:02:33 +03:00 committed by The Qt Project
parent c67a5df8d8
commit 0a7e6c5856
2 changed files with 3 additions and 0 deletions

View File

@ -149,6 +149,7 @@ QCoreTextFontDatabase::QCoreTextFontDatabase()
// layout of the primary display
NSDictionary *d = (NSDictionary *) IODisplayCreateInfoDictionary(iodisplay, kIODisplayOnlyPreferredName);
uint displaySubpixelLayout = [[d objectForKey:@kDisplaySubPixelLayout] unsignedIntValue];
[d release];
font_smoothing = (displaySubpixelLayout == kDisplaySubPixelLayoutUndefined ? 0 : 1);
[pool release];
@ -382,6 +383,7 @@ QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData
NSLog(@"Unable to register font: %@", error);
CFRelease(error);
}
CGFontRelease(cgFont);
}
} else {
CFErrorRef error;

View File

@ -501,6 +501,7 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
}
CGContextRelease(ctx);
CGColorSpaceRelease(colorspace);
return im;
}