bugfix from 11860, the derived mesh was getting free'd twice (crashed

editmode + linked-dupes + texture-drawtype)

Also fixed own bug with face mode setting (wasnt checking for texface)
This commit is contained in:
2007-09-27 20:41:56 +00:00
parent 0345b3b221
commit 18bd726f0b
3 changed files with 12 additions and 6 deletions

View File

@@ -2410,9 +2410,14 @@ static int draw_mesh_object(Base *base, int dt, int flag)
if(dt>OB_WIRE) init_gl_materials(ob, 0); // no transp in editmode, the fancy draw over goes bad then
draw_em_fancy(ob, G.editMesh, cageDM, finalDM, dt);
if (cageDM != finalDM)
/* TODO, not 100% sure this is correct,
* however I could not make it crash or leak ram with different
* linked-dup/modifier configurtions,
* should double check whats going on before release - Campbell */
if (cageDM != finalDM) {
cageDM->release(cageDM);
finalDM->release(finalDM);
finalDM->release(finalDM);
}
}
else if(!G.obedit && (G.f & G_SCULPTMODE) &&(G.scene->sculptdata.flags & SCULPT_DRAW_FAST) &&
OBACT==ob && !sculpt_modifiers_active(ob)) {

View File

@@ -5111,9 +5111,10 @@ void mesh_set_face_flags(short mode)
short m_tex=0, m_tiles=0, m_shared=0, m_light=0, m_invis=0, m_collision=0, m_twoside=0, m_obcolor=0;
short flag = 0, change = 0;
if(G.obedit==0) return;
if(G.obedit->type != OB_MESH) return;
if (!EM_texFaceCheck()) {
error("not a mesh with uv/image layers");
return;
}
add_numbut(0, TOG|SHO, "Texture", 0, 0, &m_tex, NULL);
add_numbut(1, TOG|SHO, "Tiles", 0, 0, &m_tiles, NULL);

View File

@@ -2768,7 +2768,7 @@ static uiBlock *view3d_edit_mesh_facesmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Quads to Triangles|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Triangles to Quads|Alt J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip Triangle Edges|Ctrl F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip Triangle Edges|Ctrl Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");