mesa: add NULL checking to free_shared_state()
This will allow us to call this function from _mesa_alloc_shared_state() in the case that we run out of memory part way through allocating the state. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
This commit is contained in:
@@ -394,8 +394,12 @@ _mesa_init_shared_handles(struct gl_shared_state *shared)
|
||||
void
|
||||
_mesa_free_shared_handles(struct gl_shared_state *shared)
|
||||
{
|
||||
_mesa_hash_table_u64_destroy(shared->TextureHandles, NULL);
|
||||
_mesa_hash_table_u64_destroy(shared->ImageHandles, NULL);
|
||||
if (shared->TextureHandles)
|
||||
_mesa_hash_table_u64_destroy(shared->TextureHandles, NULL);
|
||||
|
||||
if (shared->ImageHandles)
|
||||
_mesa_hash_table_u64_destroy(shared->ImageHandles, NULL);
|
||||
|
||||
mtx_destroy(&shared->HandlesMutex);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user