浏览代码

minor refcounting issue

David Rose 13 年之前
父节点
当前提交
1bd2db3b20
共有 2 个文件被更改,包括 7 次插入3 次删除
  1. 6 2
      panda/src/distort/projectionScreen.cxx
  2. 1 1
      panda/src/pgraph/sceneGraphReducer.cxx

+ 6 - 2
panda/src/distort/projectionScreen.cxx

@@ -509,8 +509,12 @@ recompute_geom_node(const WorkingNodePath &np, LMatrix4 &rel_mat,
 
   int num_geoms = node->get_num_geoms();
   for (int i = 0; i < num_geoms; i++) {
-    Geom *geom = node->modify_geom(i);
-    recompute_geom(geom, rel_mat);
+    PT(Geom) geom = node->modify_geom(i);
+    distort_cat.debug() 
+      << "  " << *node << " got geom " << geom
+      << ", cache_ref = " << geom->get_cache_ref_count() << "\n";
+    geom->test_ref_count_integrity();
+    //recompute_geom(geom, rel_mat);
   }
 }
 

+ 1 - 1
panda/src/pgraph/sceneGraphReducer.cxx

@@ -947,7 +947,7 @@ r_make_nonindexed(PandaNode *node, int nonindexed_bits) {
       if ((nonindexed_bits & this_geom_bits) == 0) {
         // The geom meets the user's qualifications for making
         // nonindexed, so do it.
-        Geom *mgeom = DCAST(Geom, geom_node->modify_geom(i));
+        PT(Geom) mgeom = geom_node->modify_geom(i);
         num_changed += mgeom->make_nonindexed((nonindexed_bits & MN_composite_only) != 0);
       }
     }