Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-08-17 00:55:11 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-08-17 00:58:29 +0300
commit1e26345a89afd24ada035af133a9d5b5ba1ac278 (patch)
tree8b7d16540eb87c246b464dd44b5e81ffb9f2ffc6 /source
parent7d29c9a16b815b51bdd7539bbef2332e2ce94ec4 (diff)
Fix T56418: Changing to Solid View crashes Blender
Everything seems to behave like it should when drawdata is alloced on instances.
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/intern/draw_manager.c18
1 files changed, 1 insertions, 17 deletions
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. */