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:
Máximo Castañeda 2024-04-18 20:06:21 +02:00 committed by waddlesplash
parent f657c49d1c
commit 31e7087b07
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}