浏览代码

fix obscure text-rendering crash

David Rose 13 年之前
父节点
当前提交
4183b88c44
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      panda/src/text/dynamicTextFont.cxx

+ 1 - 1
panda/src/text/dynamicTextFont.cxx

@@ -195,7 +195,7 @@ garbage_collect() {
   Cache::iterator ci;
   Cache::iterator ci;
   for (ci = _cache.begin(); ci != _cache.end(); ++ci) {
   for (ci = _cache.begin(); ci != _cache.end(); ++ci) {
     DynamicTextGlyph *glyph = (*ci).second;
     DynamicTextGlyph *glyph = (*ci).second;
-    if (glyph->_geom_count != 0) {
+    if (glyph == (DynamicTextGlyph *)NULL || glyph->_geom_count != 0) {
       // Keep this one.
       // Keep this one.
       new_cache.insert(new_cache.end(), (*ci));
       new_cache.insert(new_cache.end(), (*ci));
     } else {
     } else {