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
This commit is contained in:
parent
97175f8fa1
commit
c823b5ddba
@ -2168,6 +2168,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 stride;
|
int stride;
|
||||||
int offset;
|
int offset;
|
||||||
@ -2210,10 +2211,13 @@ 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,
|
dmabuf_handle =
|
||||||
width, height, stride, offset, bpp,
|
cogl_dma_buf_handle_new (dmabuf_fb, dmabuf_fd,
|
||||||
new_bo,
|
width, height, stride, offset, bpp,
|
||||||
(GDestroyNotify) gbm_bo_destroy);
|
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