[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35453] trunk/blender/source/blender: fix [#26442] blender crash when turning off antialiasing fonts

Campbell Barton ideasman42 at gmail.com
Thu Mar 10 14:49:47 CET 2011


Revision: 35453
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35453
Author:   campbellbarton
Date:     2011-03-10 13:49:46 +0000 (Thu, 10 Mar 2011)
Log Message:
-----------
fix [#26442] blender crash when turning off antialiasing fonts
ASCII lookup table wasn't being freed when when the rest of the glyphs were.

Also found own bug where mesh stat text was using wrong sized array (char[3] as char[4]).

Modified Paths:
--------------
    trunk/blender/source/blender/blenfont/intern/blf_glyph.c
    trunk/blender/source/blender/editors/space_view3d/drawobject.c

Modified: trunk/blender/source/blender/blenfont/intern/blf_glyph.c
===================================================================
--- trunk/blender/source/blender/blenfont/intern/blf_glyph.c	2011-03-10 12:52:18 UTC (rev 35452)
+++ trunk/blender/source/blender/blenfont/intern/blf_glyph.c	2011-03-10 13:49:46 UTC (rev 35453)
@@ -135,6 +135,8 @@
 			}
 		}
 	}
+
+	memset(font->glyph_ascii_table, 0, sizeof(font->glyph_ascii_table));
 }
 
 void blf_glyph_cache_free(GlyphCacheBLF *gc)

Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c	2011-03-10 12:52:18 UTC (rev 35452)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c	2011-03-10 13:49:46 UTC (rev 35453)
@@ -663,7 +663,7 @@
 					col_pack_prev= vos->col.pack;
 				}
 				if(vos->flag & V3D_CACHE_TEXT_ASCII) {
-					BLF_draw_default((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len);
+					BLF_draw_default_ascii((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len);
 				}
 				else {
 					BLF_draw_default((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len);
@@ -2123,7 +2123,7 @@
 	float fvec[3];
 	char val[32]; /* Stores the measurement display text here */
 	const char *conv_float; /* Use a float conversion matching the grid size */
-	unsigned char col[3]; /* color of the text to draw */
+	unsigned char col[4]= {0, 0, 0, 255}; /* color of the text to draw */
 	float area; /* area of the face */
 	float grid= unit->system ? unit->scale_length : v3d->grid;
 	const int do_split= unit->flag & USER_UNIT_OPT_SPLIT;




More information about the Bf-blender-cvs mailing list