Mercurial > mplayer.hg
comparison libass/ass_cache.c @ 19545:8f46b547db39
Simplify ass_glyph_cache_reset().
author | eugeni |
---|---|
date | Sat, 26 Aug 2006 20:09:54 +0000 |
parents | 64009ae411fb |
children | bcc792bfa431 |
comparison
equal
deleted
inserted
replaced
19544:32cfda1ff555 | 19545:8f46b547db39 |
---|---|
188 { | 188 { |
189 glyph_hash_root = calloc(GLYPH_HASH_SIZE, sizeof(glyph_hash_item_p)); | 189 glyph_hash_root = calloc(GLYPH_HASH_SIZE, sizeof(glyph_hash_item_p)); |
190 glyph_hash_size = 0; | 190 glyph_hash_size = 0; |
191 } | 191 } |
192 | 192 |
193 void ass_glyph_cache_reset(void) | 193 void ass_glyph_cache_done(void) |
194 { | 194 { |
195 int i; | 195 int i; |
196 for (i = 0; i < GLYPH_HASH_SIZE; ++i) { | 196 for (i = 0; i < GLYPH_HASH_SIZE; ++i) { |
197 glyph_hash_item_t* item = glyph_hash_root[i]; | 197 glyph_hash_item_t* item = glyph_hash_root[i]; |
198 while (item) { | 198 while (item) { |
201 if (item->val.outline_glyph) FT_Done_Glyph(item->val.outline_glyph); | 201 if (item->val.outline_glyph) FT_Done_Glyph(item->val.outline_glyph); |
202 free(item); | 202 free(item); |
203 item = next; | 203 item = next; |
204 } | 204 } |
205 } | 205 } |
206 free(glyph_hash_root); | |
206 glyph_hash_size = 0; | 207 glyph_hash_size = 0; |
207 } | 208 } |
208 | 209 |
209 void ass_glyph_cache_done(void) | 210 void ass_glyph_cache_reset(void) |
210 { | 211 { |
211 ass_glyph_cache_reset(); | 212 ass_glyph_cache_done(); |
212 free(glyph_hash_root); | 213 ass_glyph_cache_init(); |
213 } | 214 } |
214 | 215 |