diff --git a/src/distance_func_matrix.cpp b/src/distance_func_matrix.cpp
index 7ce9e5aa019f982b24c989c3b3078d39157b7130..fca95def495f453d25090e4d85465ea1eb38b439 100644
--- a/src/distance_func_matrix.cpp
+++ b/src/distance_func_matrix.cpp
@@ -229,6 +229,8 @@ FCL_REAL BVHDistance(const CollisionGeometry* o1, const Transform3f& tf1, const
 
   initialize(node, *obj1_tmp, tf1_tmp, *obj2_tmp, tf2_tmp, request, result);
   distance(&node);
+  delete obj1_tmp;
+  delete obj2_tmp;
   
   return result.min_distance;
 }