Commit 1a63cded authored by Erwan Tulou's avatar 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)
parent c8cce5ff
...@@ -355,7 +355,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -355,7 +355,7 @@ static int Create( vlc_object_t *p_this )
dialog_progress_bar_t *p_dialog = dialog_ProgressCreate( p_filter, dialog_progress_bar_t *p_dialog = dialog_ProgressCreate( p_filter,
_("Building font cache"), _("Building font cache"),
_("Please wait while your font cache is rebuilt.\n" _("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 ); char *path = xmalloc( PATH_MAX + 1 );
/* Fontconfig doesnt seem to know where windows fonts are with /* Fontconfig doesnt seem to know where windows fonts are with
* current contribs. So just tell default windows font directory * current contribs. So just tell default windows font directory
...@@ -436,6 +436,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -436,6 +436,7 @@ static int Create( vlc_object_t *p_this )
{ {
dialog_ProgressSet( p_dialog, NULL, 1.0 ); dialog_ProgressSet( p_dialog, NULL, 1.0 );
dialog_ProgressDestroy( p_dialog ); dialog_ProgressDestroy( p_dialog );
p_dialog = NULL;
} }
# endif # endif
...@@ -505,6 +506,12 @@ error: ...@@ -505,6 +506,12 @@ error:
if( fontmatch ) FcPatternDestroy( fontmatch ); if( fontmatch ) FcPatternDestroy( fontmatch );
if( fontpattern ) FcPatternDestroy( fontpattern ); if( fontpattern ) FcPatternDestroy( fontpattern );
#endif #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_face ) FT_Done_Face( p_sys->p_face );
if( p_sys->p_library ) FT_Done_FreeType( p_sys->p_library ); if( p_sys->p_library ) FT_Done_FreeType( p_sys->p_library );
free( psz_fontfamily ); free( psz_fontfamily );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment