Bugfix:
Drawing linked duplicates in editmode leaked memory, and could also crash. This fixes the memory leak, and hopefully also the crash.
This commit is contained in:
		@@ -530,7 +530,7 @@ void draw_uvs_sima(void)
 | 
			
		||||
		) {
 | 
			
		||||
			/* we can use the existing final mesh */
 | 
			
		||||
			glColor3ub(112, 112, 112);
 | 
			
		||||
			G.editMesh->derivedFinal->drawUVEdges(G.editMesh->derivedFinal);
 | 
			
		||||
			em->derivedFinal->drawUVEdges(em->derivedFinal);
 | 
			
		||||
		} else {
 | 
			
		||||
			DerivedMesh *finalDM, *cageDM;
 | 
			
		||||
			
 | 
			
		||||
 
 | 
			
		||||
@@ -2417,15 +2417,9 @@ 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);
 | 
			
		||||
 | 
			
		||||
		/* 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);
 | 
			
		||||
		if (G.obedit!=ob && 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)) {
 | 
			
		||||
		sculptmode_draw_mesh(0);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user