]> git.sesse.net Git - vlc/commitdiff
freetype: fix a forgotten dialog progress bar when an error arises
authorErwan Tulou <erwan10@videolan.org>
Tue, 26 Jan 2010 21:34:06 +0000 (22:34 +0100)
committerErwan Tulou <erwan10@videolan.org>
Tue, 26 Jan 2010 21:47:22 +0000 (22:47 +0100)
With wine, this module goes through the error procedure, but forgets to
deallocate the progress bar (stuck to 80%).
This patch simply cleans it up so that vlc can still be used satisfactorily.
(an error message is also issued anyway)

modules/misc/freetype.c

index eecf37351213772513af0fca3a9d7241ee5bf54e..5ef46409adc24c1a615a3aad8d07b784d2b4da02 100644 (file)
@@ -355,7 +355,7 @@ static int Create( vlc_object_t *p_this )
     dialog_progress_bar_t *p_dialog = dialog_ProgressCreate( p_filter,
             _("Building font cache"),
             _("Please wait while your font cache is rebuilt.\n"
-                "This should take less than few minutes."), NULL );
+                "This should take less than few minutes."), NULL );
     char *path = xmalloc( PATH_MAX + 1 );
     /* Fontconfig doesnt seem to know where windows fonts are with
      * current contribs. So just tell default windows font directory
@@ -436,6 +436,7 @@ static int Create( vlc_object_t *p_this )
     {
         dialog_ProgressSet( p_dialog, NULL, 1.0 );
         dialog_ProgressDestroy( p_dialog );
+        p_dialog = NULL;
     }
 # endif
 
@@ -505,6 +506,12 @@ error:
     if( fontmatch ) FcPatternDestroy( fontmatch );
     if( fontpattern ) FcPatternDestroy( fontpattern );
 #endif
+
+#ifdef WIN32
+    if( p_dialog )
+        dialog_ProgressDestroy( p_dialog );
+#endif
+
     if( p_sys->p_face ) FT_Done_Face( p_sys->p_face );
     if( p_sys->p_library ) FT_Done_FreeType( p_sys->p_library );
     free( psz_fontfamily );