clutter/paint-nodes: Use g_autoptr
Tighten up the refcount of the CoglTexture created by the blur node. This seems to make Coverity happier. Coverity CID: #1575122 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4175>
This commit is contained in:
parent
2e61e58b57
commit
38d4962c20
@ -1598,13 +1598,13 @@ clutter_blur_node_new (unsigned int width,
|
|||||||
float radius)
|
float radius)
|
||||||
{
|
{
|
||||||
g_autoptr (CoglOffscreen) offscreen = NULL;
|
g_autoptr (CoglOffscreen) offscreen = NULL;
|
||||||
|
g_autoptr (CoglTexture) texture = NULL;
|
||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
ClutterLayerNode *layer_node;
|
ClutterLayerNode *layer_node;
|
||||||
ClutterBlurNode *blur_node;
|
ClutterBlurNode *blur_node;
|
||||||
ClutterContext *context;
|
ClutterContext *context;
|
||||||
ClutterBackend *backend;
|
ClutterBackend *backend;
|
||||||
CoglContext *cogl_context;
|
CoglContext *cogl_context;
|
||||||
CoglTexture *texture;
|
|
||||||
ClutterBlur *blur;
|
ClutterBlur *blur;
|
||||||
|
|
||||||
g_return_val_if_fail (radius >= 0.0, NULL);
|
g_return_val_if_fail (radius >= 0.0, NULL);
|
||||||
@ -1618,7 +1618,6 @@ clutter_blur_node_new (unsigned int width,
|
|||||||
cogl_texture_set_premultiplied (texture, TRUE);
|
cogl_texture_set_premultiplied (texture, TRUE);
|
||||||
|
|
||||||
offscreen = cogl_offscreen_new_with_texture (texture);
|
offscreen = cogl_offscreen_new_with_texture (texture);
|
||||||
g_object_unref (texture);
|
|
||||||
if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (offscreen), &error))
|
if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (offscreen), &error))
|
||||||
{
|
{
|
||||||
g_warning ("Unable to allocate paint node offscreen: %s",
|
g_warning ("Unable to allocate paint node offscreen: %s",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user