texture-mipmap: Fix some leaks and tidy up
Seems we were leaking mipmap->mipmap_texture and mipmap->fb. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2562>
This commit is contained in:
parent
8fcee7a8a5
commit
8019714b5d
1 changed files with 5 additions and 7 deletions
|
@ -68,8 +68,9 @@ meta_texture_mipmap_free (MetaTextureMipmap *mipmap)
|
|||
g_return_if_fail (mipmap != NULL);
|
||||
|
||||
cogl_clear_object (&mipmap->pipeline);
|
||||
|
||||
meta_texture_mipmap_set_base_texture (mipmap, NULL);
|
||||
cogl_clear_object (&mipmap->base_texture);
|
||||
cogl_clear_object (&mipmap->mipmap_texture);
|
||||
g_clear_object (&mipmap->fb);
|
||||
|
||||
g_free (mipmap);
|
||||
}
|
||||
|
@ -86,17 +87,14 @@ meta_texture_mipmap_free (MetaTextureMipmap *mipmap)
|
|||
*/
|
||||
void
|
||||
meta_texture_mipmap_set_base_texture (MetaTextureMipmap *mipmap,
|
||||
CoglTexture *texture)
|
||||
CoglTexture *texture)
|
||||
{
|
||||
g_return_if_fail (mipmap != NULL);
|
||||
|
||||
if (texture == mipmap->base_texture)
|
||||
return;
|
||||
|
||||
if (mipmap->base_texture != NULL)
|
||||
{
|
||||
cogl_object_unref (mipmap->base_texture);
|
||||
}
|
||||
cogl_clear_object (&mipmap->base_texture);
|
||||
|
||||
mipmap->base_texture = texture;
|
||||
|
||||
|
|
Loading…
Reference in a new issue