Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-11-08 13:54:04 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-11-08 13:54:04 +0300
commit0085001eb0e375108b3a3b35197fe4788272c136 (patch)
treeaac672ca32d882407f85cfe7a2498352dbaecd97 /source/blender/blenkernel/intern/rigidbody.c
parenta2d78d7a460302dc3724c8b9efd5b4921e49f762 (diff)
Fix memory leak when Blender is build without Bullet and files with RB is opened
Diffstat (limited to 'source/blender/blenkernel/intern/rigidbody.c')
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index f8e96225f36..ebf9f017731 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -65,13 +65,22 @@
#include "BKE_rigidbody.h"
#include "BKE_scene.h"
-#ifdef WITH_BULLET
-
/* ************************************** */
/* Memory Management */
/* Freeing Methods --------------------- */
+#ifndef WITH_BULLET
+
+static void RB_dworld_remove_constraint(void *UNUSED(world), void *UNUSED(con)) {}
+static void RB_dworld_remove_body(void *UNUSED(world), void *UNUSED(body)) {}
+static void RB_dworld_delete(void *UNUSED(world)) {}
+static void RB_body_delete(void *UNUSED(body)) {}
+static void RB_shape_delete(void *UNUSED(shape)) {}
+static void RB_constraint_delete(void *UNUSED(con)) {}
+
+#endif
+
/* Free rigidbody world */
void BKE_rigidbody_free_world(RigidBodyWorld *rbw)
{
@@ -165,6 +174,8 @@ void BKE_rigidbody_free_constraint(Object *ob)
ob->rigidbody_constraint = NULL;
}
+#ifdef WITH_BULLET
+
/* Copying Methods --------------------- */
/* These just copy the data, clearing out references to physics objects.
@@ -1620,9 +1631,6 @@ void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
# pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
-void BKE_rigidbody_free_world(RigidBodyWorld *rbw) {}
-void BKE_rigidbody_free_object(Object *ob) {}
-void BKE_rigidbody_free_constraint(Object *ob) {}
struct RigidBodyOb *BKE_rigidbody_copy_object(Object *ob) { return NULL; }
struct RigidBodyCon *BKE_rigidbody_copy_constraint(Object *ob) { return NULL; }
void BKE_rigidbody_relink_constraint(RigidBodyCon *rbc) {}