From acd09c21f7e3f261b584eaf9136966439eaf3a8b Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 18 Sep 2011 22:04:09 +0200 Subject: [directfb] Use QScopedPointer to manage heap allocated objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use QScopedPointer to avoid trying to manually delete objects. For some of the cases the leak would only be viewable when things are getting shut down. Leave in some more warnings for cleaning it up, e.g. the m_eventBuffer of the Input is leaked and the input task will only stop after another key event. Change-Id: Ic54568343605b4ab7094a7dece40e22250184a37 Reviewed-by: Jørgen Lind --- src/plugins/platforms/directfb/qdirectfbbackingstore.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/plugins/platforms/directfb/qdirectfbbackingstore.cpp') diff --git a/src/plugins/platforms/directfb/qdirectfbbackingstore.cpp b/src/plugins/platforms/directfb/qdirectfbbackingstore.cpp index b45de1b25e..b20c9f0d0d 100644 --- a/src/plugins/platforms/directfb/qdirectfbbackingstore.cpp +++ b/src/plugins/platforms/directfb/qdirectfbbackingstore.cpp @@ -65,17 +65,12 @@ QDirectFbBackingStore::QDirectFbBackingStore(QWindow *window) QDirectFbBlitter *blitter = new QDirectFbBlitter(window->size(), m_dfbSurface); m_pmdata = new QDirectFbBlitterPlatformPixmap; m_pmdata->setBlittable(blitter); - m_pixmap = new QPixmap(m_pmdata); -} - -QDirectFbBackingStore::~QDirectFbBackingStore() -{ - delete m_pixmap; + m_pixmap.reset(new QPixmap(m_pmdata)); } QPaintDevice *QDirectFbBackingStore::paintDevice() { - return m_pixmap; + return m_pixmap.data(); } void QDirectFbBackingStore::flush(QWindow *, const QRegion ®ion, const QPoint &offset) -- cgit v1.2.3