mirror of
https://github.com/brl/mutter.git
synced 2024-12-24 12:02:04 +00:00
material: Check before unreferencing a texture
When disposing a material layer of type 'texture' we should check that the texture handle is still valid before calling cogl_handle_unref(). This avoids an assertion failure when disposing a ClutterTexture.
This commit is contained in:
parent
6b5934a18e
commit
58827bb54c
@ -4457,7 +4457,8 @@ _cogl_material_layer_free (CoglMaterialLayer *layer)
|
||||
}
|
||||
}
|
||||
|
||||
if (layer->differences & COGL_MATERIAL_LAYER_STATE_TEXTURE)
|
||||
if (layer->differences & COGL_MATERIAL_LAYER_STATE_TEXTURE &&
|
||||
layer->texture != COGL_INVALID_HANDLE)
|
||||
cogl_handle_unref (layer->texture);
|
||||
|
||||
if (layer->differences & COGL_MATERIAL_LAYER_STATE_NEEDS_BIG_STATE)
|
||||
|
Loading…
Reference in New Issue
Block a user