[Bf-blender-cvs] [1e26345a89a] blender2.8: Fix T56418: Changing to Solid View crashes Blender

Clément Foucault noreply at git.blender.org
Fri Aug 17 00:00:27 CEST 2018


Commit: 1e26345a89afd24ada035af133a9d5b5ba1ac278
Author: Clément Foucault
Date:   Thu Aug 16 23:55:11 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB1e26345a89afd24ada035af133a9d5b5ba1ac278

Fix T56418: Changing to Solid View crashes Blender

Everything seems to behave like it should when drawdata is alloced
on instances.

===================================================================

M	source/blender/draw/intern/draw_manager.c

===================================================================

diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 5140e379aaf..47c0afc6231 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -834,23 +834,7 @@ DrawData *DRW_drawdata_ensure(
 	DrawDataList *drawdata = DRW_drawdatalist_from_id(id);
 
 	/* Allocate new data. */
-	if ((GS(id->name) == ID_OB) && (((Object *)id)->base_flag & BASE_FROMDUPLI) != 0) {
-		/* NOTE: data is not persistent in this case. It is reset each redraw. */
-		BLI_assert(free_cb == NULL); /* No callback allowed. */
-		/* Round to sizeof(float) for DRW_instance_data_request(). */
-		const size_t t = sizeof(float) - 1;
-		size = (size + t) & ~t;
-		size_t fsize = size / sizeof(float);
-		BLI_assert(fsize < MAX_INSTANCE_DATA_SIZE);
-		if (DST.object_instance_data[fsize] == NULL) {
-			DST.object_instance_data[fsize] = DRW_instance_data_request(DST.idatalist, fsize);
-		}
-		dd = (DrawData *)DRW_instance_data_next(DST.object_instance_data[fsize]);
-		memset(dd, 0, size);
-	}
-	else {
-		dd = MEM_callocN(size, "DrawData");
-	}
+	dd = MEM_callocN(size, "DrawData");
 	dd->engine_type = engine_type;
 	dd->free = free_cb;
 	/* Perform user-side initialization, if needed. */



More information about the Bf-blender-cvs mailing list