svn merge -r 12691:12716 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / src / editobject.c
index 8f40742852ee41483784e0f04320fd89b005099f..597e15154998b58d3992a6fee6beaf035ac9609c 100644 (file)
 #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"
@@ -1758,6 +1759,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));