[vlc-commits] freetype: unify conditional cleanup conditions

Francois Cartegnie git at videolan.org
Tue Jul 21 16:07:20 CEST 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jul  1 17:32:24 2020 +0200| [4972bf653dbcc6d431dc52c2383957987c1c0884] | committer: Francois Cartegnie

freetype: unify conditional cleanup conditions

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4972bf653dbcc6d431dc52c2383957987c1c0884
---

 modules/text_renderer/freetype/freetype.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index cb8494a026..813a4f86dd 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -1489,7 +1489,10 @@ static int Create( vlc_object_t *p_this )
     p_sys->pf_get_family = FontConfig_GetFamily;
     p_sys->pf_get_fallbacks = FontConfig_GetFallbacks;
     if( FontConfig_Prepare( p_filter ) )
+    {
+        p_sys->pf_get_family = NULL;
         goto error;
+    }
 
 #elif defined( __APPLE__ )
     p_sys->pf_get_family = CoreText_GetFamily;
@@ -1536,9 +1539,6 @@ static int Create( vlc_object_t *p_this )
     {
         msg_Err( p_filter, "Error loading default face %s",
                  p_sys->p_default_style->psz_fontname );
-#ifdef HAVE_FONTCONFIG
-        FontConfig_Unprepare();
-#endif
         goto error;
     }
 
@@ -1600,7 +1600,7 @@ static void Destroy( vlc_object_t *p_this )
     }
 
 #ifdef HAVE_FONTCONFIG
-    if( p_sys->p_face != NULL )
+    if( p_sys->pf_get_family == FontConfig_GetFamily )
         FontConfig_Unprepare();
 
 #elif defined( _WIN32 )



More information about the vlc-commits mailing list