app_server: remove new font family from the manager in case of error
Change-Id: I8a1538b9706ed1c6eb5d104332ddbf3b7f223faa Reviewed-on: https://review.haiku-os.org/c/haiku/+/7632 Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org> Reviewed-by: Jérôme Duval <jerome.duval@gmail.com> Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
parent
f657c49d1c
commit
31e7087b07
|
@ -329,8 +329,10 @@ FontManager::_AddFont(FT_Face face, node_ref nodeRef, const char* path,
|
|||
|
||||
if (style == NULL || !family->AddStyle(style)) {
|
||||
delete style;
|
||||
if (isNewFontFamily)
|
||||
if (isNewFontFamily) {
|
||||
fFamilies.RemoveItem(family);
|
||||
delete family;
|
||||
}
|
||||
return B_NO_MEMORY;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue