mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 17:10:40 -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:
|
||||
{
|
||||
CoglFramebuffer *dmabuf_fb;
|
||||
CoglDmaBufHandle *dmabuf_handle;
|
||||
struct gbm_bo *new_bo;
|
||||
int stride;
|
||||
int offset;
|
||||
@ -2210,10 +2211,13 @@ meta_renderer_native_create_dma_buf (CoglRenderer *cogl_renderer,
|
||||
if (!dmabuf_fb)
|
||||
return NULL;
|
||||
|
||||
return cogl_dma_buf_handle_new (dmabuf_fb, dmabuf_fd,
|
||||
width, height, stride, offset, bpp,
|
||||
new_bo,
|
||||
(GDestroyNotify) gbm_bo_destroy);
|
||||
dmabuf_handle =
|
||||
cogl_dma_buf_handle_new (dmabuf_fb, dmabuf_fd,
|
||||
width, height, stride, offset, bpp,
|
||||
new_bo,
|
||||
(GDestroyNotify) gbm_bo_destroy);
|
||||
cogl_object_unref (dmabuf_fb);
|
||||
return dmabuf_handle;
|
||||
}
|
||||
break;
|
||||
#ifdef HAVE_EGL_DEVICE
|
||||
|
Loading…
Reference in New Issue
Block a user