DRW: Fix T54135 : Crash caused by wrongly iterating over ListBase.

This commit is contained in:
Clément Foucault 2018-02-22 19:47:41 +01:00
parent d4795cc5d1
commit 8115162e98
Notes: blender-bot 2023-02-14 06:54:28 +01:00
Referenced by issue #54135, Crash when edit mode with clay in 2.79 file (bmw)
1 changed files with 1 additions and 1 deletions

View File

@ -110,7 +110,7 @@ static void instance_batch_free(Gwn_Batch *batch, void *UNUSED(user_data))
/* TODO: Make it thread safe! Batch freeing can happen from another thread. */
/* XXX we need to iterate over all idatalists unless we make some smart
* data structure to store the locations to update. */
for (DRWInstanceDataList *idatalist = g_idatalists.first; idatalist; ++idatalist) {
for (DRWInstanceDataList *idatalist = g_idatalists.first; idatalist; idatalist = idatalist->next) {
DRWInstancingBuffer *ibuf = idatalist->instancing.ibufs;
for (int i = 0; i < idatalist->instancing.alloc_size; i++, ibuf++) {
if (ibuf->instance == batch) {