Fix crash entering editmode
This commit is contained in:
parent
78a6c2e12c
commit
ff0a29df14
|
@ -75,8 +75,10 @@ Base **BKE_view_layer_array_from_bases_in_mode_params(
|
|||
BLI_array_append(base_array, base_iter);
|
||||
} FOREACH_BASE_IN_MODE_END;
|
||||
|
||||
if (base_array != NULL) {
|
||||
base_array = MEM_reallocN(base_array, sizeof(*base_array) * BLI_array_len(base_array));
|
||||
base_array = MEM_reallocN(base_array, sizeof(*base_array) * BLI_array_len(base_array));
|
||||
/* We always need a valid allocation (prevent crash on free). */
|
||||
if (base_array == NULL) {
|
||||
base_array = MEM_mallocN(0, __func__);
|
||||
}
|
||||
*r_len = BLI_array_len(base_array);
|
||||
return base_array;
|
||||
|
|
Loading…
Reference in New Issue