/*
+ ******************************************************************************
+ * © 2016 and later: Unicode, Inc. and others. *
+ * License & terms of use: http://www.unicode.org/copyright.html#License *
+ ******************************************************************************
******************************************************************************
* Copyright (C) 1998-2003, International Business Machines Corporation and *
* others. All Rights Reserved. *
const LEFontInstance *GDIFontMap::openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status)
{
- return new GDIFontInstance(fSurface, fontName, pointSize, status);
+ LEFontInstance *result = new GDIFontInstance(fSurface, fontName, pointSize, status);
+
+ if (LE_FAILURE(status)) {
+ delete result;
+ result = NULL;
+ }
+
+ return result;
}