mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05: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
b4120b81e4
commit
283dce8e21
@ -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);
|
cogl_handle_unref (layer->texture);
|
||||||
|
|
||||||
if (layer->differences & COGL_MATERIAL_LAYER_STATE_NEEDS_BIG_STATE)
|
if (layer->differences & COGL_MATERIAL_LAYER_STATE_NEEDS_BIG_STATE)
|
||||||
|
Loading…
Reference in New Issue
Block a user