Cocoa: fix coretext memory leaks
Change-Id: Id85dbf8a2ea8994d9fca07d3f10b43f62ec305a0 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
parent
c67a5df8d8
commit
0a7e6c5856
@ -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;
|
||||
|
@ -501,6 +501,7 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
|
||||
}
|
||||
|
||||
CGContextRelease(ctx);
|
||||
CGColorSpaceRelease(colorspace);
|
||||
|
||||
return im;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user