replace calls to BLI_linklist_append with BLI_linklist_prepend where order us unimportant, since append steps over the whole list each time.
This commit is contained in:
@@ -2421,8 +2421,8 @@ static void write_soops(WriteData *wd, SpaceOops *so, LinkNode **tmp_mem_list)
|
||||
* outliners in a screen we might get the same address on the next
|
||||
* malloc, which makes the address no longer unique and so invalid for
|
||||
* lookups on file read, causing crashes or double frees */
|
||||
BLI_linklist_append(tmp_mem_list, ts_flat);
|
||||
BLI_linklist_append(tmp_mem_list, data);
|
||||
BLI_linklist_prepend(tmp_mem_list, ts_flat);
|
||||
BLI_linklist_prepend(tmp_mem_list, data);
|
||||
}
|
||||
else {
|
||||
so->treestore = NULL;
|
||||
|
||||
@@ -1216,7 +1216,7 @@ static LinkNode *image_free_queue = NULL;
|
||||
static void gpu_queue_image_for_free(Image *ima)
|
||||
{
|
||||
BLI_lock_thread(LOCK_OPENGL);
|
||||
BLI_linklist_append(&image_free_queue, ima);
|
||||
BLI_linklist_prepend(&image_free_queue, ima);
|
||||
BLI_unlock_thread(LOCK_OPENGL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user