From 500dc2a6f888e283c6d40730bdf7c2998ee0437b Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 19 Sep 2011 00:57:45 +0200 Subject: [directfb] Introduce the QDirectFBPointer from QWS/gfxdrivers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce QDirectFBPointer and use it throughout the code to fix various resource leaks in the DirectFB backend. Fix the surface ownership of the IDirectFBSurface in the Blittable/BackingStore code. Change-Id: I0d4572eaab80b3558e644f26d76222461bf37bbb Reviewed-by: Jørgen Lind --- src/plugins/platforms/directfb/qdirectfbconvenience.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/directfb/qdirectfbconvenience.cpp') diff --git a/src/plugins/platforms/directfb/qdirectfbconvenience.cpp b/src/plugins/platforms/directfb/qdirectfbconvenience.cpp index 38130c8deb..440e9b00bc 100644 --- a/src/plugins/platforms/directfb/qdirectfbconvenience.cpp +++ b/src/plugins/platforms/directfb/qdirectfbconvenience.cpp @@ -106,13 +106,17 @@ int QDirectFbConvenience::colorDepthForSurface(const DFBSurfacePixelFormat forma return ((0x1f << 7) & format) >> 7; } +/** + * This is borrowing the reference of the QDirectFbBlitter. You may not store this + * pointer as a class member but must only use it locally. + */ IDirectFBSurface *QDirectFbConvenience::dfbSurfaceForPlatformPixmap(QPlatformPixmap *handle) { QBlittablePlatformPixmap *blittablePmData = static_cast(handle); if (blittablePmData) { QBlittable *blittable = blittablePmData->blittable(); QDirectFbBlitter *dfbBlitter = static_cast(blittable); - return dfbBlitter->m_surface; + return dfbBlitter->m_surface.data(); } return 0; } -- cgit v1.2.3