changeset 32800:ddd7eb2e54c9

Make freed font reusable.
author ib
date Fri, 11 Feb 2011 12:56:25 +0000
parents 9855da8e3aa9
children ed61ab815888
files gui/skin/font.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gui/skin/font.c	Fri Feb 11 12:50:49 2011 +0000
+++ b/gui/skin/font.c	Fri Feb 11 12:56:25 2011 +0000
@@ -76,7 +76,11 @@
  av_strlcpy( tmp,path,sizeof( tmp ) );
  av_strlcat( tmp,fname,sizeof( tmp ) ); av_strlcat( tmp,".fnt",sizeof( tmp ) );
  if ( ( f=fopen( tmp,"rt" ) ) == NULL )
-   { free( Fonts[id] ); return -3; }
+  {
+   free( Fonts[id] );
+   Fonts[id] = NULL;
+   return -3;
+  }
 
  while ( fgets( tmp,255,f ) )
   {