svn merge -r 12294:12347 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / src / editobject.c
index 1c9cf15bc7e84a52ae7bb79439b5880f36e5a7d7..c8f0dec40fa00a5274cc2635915696411a42e58c 100644 (file)
@@ -99,6 +99,7 @@
 #include "BKE_customdata.h"
 #include "BKE_blender.h"
 #include "BKE_booleanops.h"
 #include "BKE_customdata.h"
 #include "BKE_blender.h"
 #include "BKE_booleanops.h"
+#include "BKE_cloth.h"
 #include "BKE_curve.h"
 #include "BKE_displist.h"
 #include "BKE_depsgraph.h"
 #include "BKE_curve.h"
 #include "BKE_displist.h"
 #include "BKE_depsgraph.h"
@@ -1745,6 +1746,10 @@ void exit_editmode(int flag)     /* freedata==0 at render, 1= freedata, 2= do undo b
                sbObjectToSoftbody(ob);
        }
        
                sbObjectToSoftbody(ob);
        }
        
+       if(modifiers_isClothEnabled(ob)) {
+               cloth_free_modifier(modifiers_isClothEnabled(ob));
+       }
+       
        if(ob->type==OB_MESH && get_mesh(ob)->mr)
                multires_edge_level_update(ob, get_mesh(ob));
        
        if(ob->type==OB_MESH && get_mesh(ob)->mr)
                multires_edge_level_update(ob, get_mesh(ob));