mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
renderer-native: Don't leak DMA buffer CoglFramebuffer
When we created the DMA buffer backed CoglFramebuffer, we handed it over
to CoglDmaBufHandle which took its own reference. What we failed to do
was to release our own reference to it, effectively leaking it.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1283
(cherry picked from commit c823b5ddba
)
This commit is contained in:
parent
dc75c7d297
commit
0d9ded403f
@ -2146,6 +2146,7 @@ meta_renderer_native_create_dma_buf (CoglRenderer *cogl_renderer,
|
|||||||
case META_RENDERER_NATIVE_MODE_GBM:
|
case META_RENDERER_NATIVE_MODE_GBM:
|
||||||
{
|
{
|
||||||
CoglFramebuffer *dmabuf_fb;
|
CoglFramebuffer *dmabuf_fb;
|
||||||
|
CoglDmaBufHandle *dmabuf_handle;
|
||||||
struct gbm_bo *new_bo;
|
struct gbm_bo *new_bo;
|
||||||
int dmabuf_fd = -1;
|
int dmabuf_fd = -1;
|
||||||
|
|
||||||
@ -2182,8 +2183,11 @@ meta_renderer_native_create_dma_buf (CoglRenderer *cogl_renderer,
|
|||||||
if (!dmabuf_fb)
|
if (!dmabuf_fb)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return cogl_dma_buf_handle_new (dmabuf_fb, dmabuf_fd, new_bo,
|
dmabuf_handle =
|
||||||
(GDestroyNotify) gbm_bo_destroy);
|
cogl_dma_buf_handle_new (dmabuf_fb, dmabuf_fd, new_bo,
|
||||||
|
(GDestroyNotify) gbm_bo_destroy);
|
||||||
|
cogl_object_unref (dmabuf_fb);
|
||||||
|
return dmabuf_handle;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_EGL_DEVICE
|
#ifdef HAVE_EGL_DEVICE
|
||||||
|
Loading…
Reference in New Issue
Block a user