Quellcode durchsuchen

cull: Fix crash caused by freeing a cull object with empty volume

Disyer vor 11 Monaten
Ursprung
Commit
cc6646a448
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 1 1
      panda/src/cull/cullBinBackToFront.cxx
  2. 1 1
      panda/src/cull/cullBinFrontToBack.cxx

+ 1 - 1
panda/src/cull/cullBinBackToFront.cxx

@@ -40,7 +40,7 @@ add_object(CullableObject *object, Thread *current_thread) {
   // Determine the center of the bounding volume.
   CPT(BoundingVolume) volume = object->_geom->get_bounds(current_thread);
   if (volume->is_empty()) {
-    delete object;
+    // No point in culling objects with no volume.
     return;
   }
 

+ 1 - 1
panda/src/cull/cullBinFrontToBack.cxx

@@ -40,7 +40,7 @@ add_object(CullableObject *object, Thread *current_thread) {
   // Determine the center of the bounding volume.
   CPT(BoundingVolume) volume = object->_geom->get_bounds();
   if (volume->is_empty()) {
-    delete object;
+    // No point in culling objects with no volume.
     return;
   }