summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandbufferref.cpp
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2014-07-25 14:46:15 +0300
committerGiulio Camuffo <giulio.camuffo@jollamobile.com>2014-07-30 16:51:41 +0200
commitc6f604d2fa3acafce05de15cb9f3195572e39285 (patch)
tree62aef3ddc009b98f3ae643cd9043c6f44776f65b /src/compositor/compositor_api/qwaylandbufferref.cpp
parent58616a794e69223903a59f5281ce39f2bffcfda3 (diff)
Destroy the SurfaceBuffers and their textures after the wl_buffer are destroyed
A SurfaceBuffer can live after its wl_buffer died, so make sure to delete it when there is no surface or buffer reference that points to it anymore. Change-Id: Id90453c74d14ca1414cb837b355430a510d5f07e Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandbufferref.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandbufferref.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compositor/compositor_api/qwaylandbufferref.cpp b/src/compositor/compositor_api/qwaylandbufferref.cpp
index 67554c7cb..e77b14be2 100644
--- a/src/compositor/compositor_api/qwaylandbufferref.cpp
+++ b/src/compositor/compositor_api/qwaylandbufferref.cpp
@@ -64,7 +64,7 @@ QWaylandBufferRef::QWaylandBufferRef(QtWayland::SurfaceBuffer *buffer)
{
d->buffer = buffer;
if (buffer)
- buffer->m_refCount.ref();
+ buffer->ref();
}
QWaylandBufferRef::QWaylandBufferRef(const QWaylandBufferRef &ref)
@@ -76,19 +76,19 @@ QWaylandBufferRef::QWaylandBufferRef(const QWaylandBufferRef &ref)
QWaylandBufferRef::~QWaylandBufferRef()
{
- if (d->buffer && !d->buffer->m_refCount.deref())
- d->buffer->disown();
+ if (d->buffer)
+ d->buffer->deref();
delete d;
}
QWaylandBufferRef &QWaylandBufferRef::operator=(const QWaylandBufferRef &ref)
{
- if (d->buffer && !d->buffer->m_refCount.deref())
- d->buffer->disown();
+ if (d->buffer)
+ d->buffer->deref();
d->buffer = ref.d->buffer;
if (d->buffer)
- d->buffer->m_refCount.ref();
+ d->buffer->ref();
return *this;
}