Code cleanup: As Sergey stated on bf-committers one should use id_us_min() if the user counter has to be decremented and not decrement the counter by hand.
This commit is contained in:
		@@ -1793,7 +1793,7 @@ static int image_new_exec(bContext *C, wmOperator *op)
 | 
				
			|||||||
		Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
 | 
							Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
 | 
				
			||||||
		if (tex && tex->type == TEX_IMAGE) {
 | 
							if (tex && tex->type == TEX_IMAGE) {
 | 
				
			||||||
			if (tex->ima)
 | 
								if (tex->ima)
 | 
				
			||||||
				tex->ima->id.us--;
 | 
									id_us_min(&tex->ima->id);
 | 
				
			||||||
			tex->ima = ima;
 | 
								tex->ima = ima;
 | 
				
			||||||
			ED_area_tag_redraw(CTX_wm_area(C));
 | 
								ED_area_tag_redraw(CTX_wm_area(C));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user