Bug 397209 - Catch ObjC exception when trying to draw to an offscreen buffer. r=josh sr=vlad a1.9=vlad

This commit is contained in:
cbarrett%mozilla.com 2007-10-05 21:24:01 +00:00
Родитель 6278f77608
Коммит e963abb7b1
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -189,7 +189,13 @@ nsNativeThemeCocoa::DrawButton(CGContextRef cgContext, ThemeButtonKind inKind,
drawFrame.size.height = offscreenHeight - NATIVE_PUSH_BUTTON_HEIGHT_DIFF;
// draw into offscreen image
[image lockFocus];
NS_DURING
[image lockFocus];
NS_HANDLER
NS_ASSERTION(0, "Could not lock focus on offscreen buffer");
[image release];
return;
NS_ENDHANDLER
[[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationLow];
HIThemeDrawButton(&drawFrame, &bdi, (CGContext*)[[NSGraphicsContext currentContext] graphicsPort], kHIThemeOrientationInverted, NULL);
[image unlockFocus];