From cc6646a448fcce061d5e89cba3cab6420d9efbae Mon Sep 17 00:00:00 2001 From: Disyer Date: Sat, 11 Jan 2025 21:32:52 +0200 Subject: [PATCH] cull: Fix crash caused by freeing a cull object with empty volume --- panda/src/cull/cullBinBackToFront.cxx | 2 +- panda/src/cull/cullBinFrontToBack.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/cull/cullBinBackToFront.cxx b/panda/src/cull/cullBinBackToFront.cxx index a8fa169304..0254c4dfdd 100644 --- a/panda/src/cull/cullBinBackToFront.cxx +++ b/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; } diff --git a/panda/src/cull/cullBinFrontToBack.cxx b/panda/src/cull/cullBinFrontToBack.cxx index 146eaaab58..dfc85dd540 100644 --- a/panda/src/cull/cullBinFrontToBack.cxx +++ b/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; }