[vlc-devel] commit: freetype: fix a forgotten dialog progress bar when an error arises (Erwan Tulou )

git version control git at videolan.org
Tue Jan 26 22:49:01 CET 2010


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Tue Jan 26 22:34:06 2010 +0100| [1a63cdeda2a72f18f9280687a9e04f16ee5f6f37] | committer: Erwan Tulou 

freetype: fix a forgotten dialog progress bar when an error arises

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)

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

 modules/misc/freetype.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c
index eecf373..5ef4640 100644
--- a/modules/misc/freetype.c
+++ b/modules/misc/freetype.c
@@ -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 a 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 );




More information about the vlc-devel mailing list