* The C constructors now properly return NULL if the C++ constructor failed.
diff --git a/include/FTInternals.h b/include/FTInternals.h
index ac0fc2d..bd64150 100644
--- a/include/FTInternals.h
+++ b/include/FTInternals.h
@@ -96,6 +96,14 @@ static inline FTGLfont *createFTFont(ftglType type, const char *fontname)
ftgl->ptr = new FTGLTextureFont(fontname);
break;
}
+
+ if(ftgl->ptr->Error())
+ {
+ delete ftgl->ptr;
+ free(ftgl);
+ return NULL;
+ }
+
return ftgl;
}