Fix unreported crash in gpu_free_unused_buffers
As far as I can see, this problem was introduced with the gpu_free_unused_buffers() changes in rB97b597c. The code checks the returned pointer to stop looping, but the last iteration will return the last GPUTexture and set the queue to NULL, meaning that the next pop() will crash. Differential Revision: https://developer.blender.org/D8468
This commit is contained in:
@@ -381,12 +381,9 @@ static void gpu_free_unused_buffers(void)
|
||||
|
||||
BLI_mutex_lock(&gpu_texture_queue_mutex);
|
||||
|
||||
if (gpu_texture_free_queue != NULL) {
|
||||
GPUTexture *tex;
|
||||
while ((tex = (GPUTexture *)BLI_linklist_pop(&gpu_texture_free_queue))) {
|
||||
GPU_texture_free(tex);
|
||||
}
|
||||
gpu_texture_free_queue = NULL;
|
||||
while (gpu_texture_free_queue != NULL) {
|
||||
GPUTexture *tex = BLI_linklist_pop(&gpu_texture_free_queue);
|
||||
GPU_texture_free(tex);
|
||||
}
|
||||
|
||||
BLI_mutex_unlock(&gpu_texture_queue_mutex);
|
||||
|
||||
Reference in New Issue
Block a user