svn merge -r 12347:12382 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / src / editobject.c
index 997593b30b1ee515f4262fd83603b3e0223286f4..628d1c3b405636a0c9f77d1708bc1360695743de 100644 (file)
@@ -99,6 +99,7 @@
 #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"
@@ -1745,6 +1746,10 @@ void exit_editmode(int flag)     /* freedata==0 at render, 1= freedata, 2= do undo b
                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));