diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-08 10:01:07 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-08 10:01:07 (GMT) |
commit | 4b14e87b72e7cd52841c5fc3183accf35c0395d1 (patch) | |
tree | a8a3e4650dad4f2e88be1c2e31fb3a4723cff195 | |
parent | 4c9e2a4376a52891a21f75e2a441848234ed93c2 (diff) | |
parent | 978416807b7e92d9317036cb4348ee172dde7d4e (diff) | |
download | Qt-4b14e87b72e7cd52841c5fc3183accf35c0395d1.zip Qt-4b14e87b72e7cd52841c5fc3183accf35c0395d1.tar.gz Qt-4b14e87b72e7cd52841c5fc3183accf35c0395d1.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Fix memory leak in QPixmap::toSymbianRSgImage() when an error occurs.
-rw-r--r-- | src/openvg/qvg_symbian.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/openvg/qvg_symbian.cpp b/src/openvg/qvg_symbian.cpp index ef0160c..a9625b2 100644 --- a/src/openvg/qvg_symbian.cpp +++ b/src/openvg/qvg_symbian.cpp @@ -228,7 +228,7 @@ void* QVGPixmapData::toNativeType(NativeType type) sgInfo.iSizeInPixels.SetSize(w, h); sgInfo.iUsage = ESgUsageBitOpenVgImage | ESgUsageBitOpenVgSurface; - RSgImage *sgImage = q_check_ptr(new RSgImage()); + QScopedPointer<RSgImage> sgImage(new RSgImage()); err = sgImage->Create(sgInfo, NULL, NULL); if (err != KErrNone) { driver.Close(); @@ -239,7 +239,7 @@ void* QVGPixmapData::toNativeType(NativeType type) EGLImageKHR eglImage = QEgl::eglCreateImageKHR(QEgl::display(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, - (EGLClientBuffer)sgImage, + (EGLClientBuffer)sgImage.data(), (EGLint*)KEglImageAttribs); if (!eglImage || eglGetError() != EGL_SUCCESS) { sgImage->Close(); @@ -261,13 +261,14 @@ void* QVGPixmapData::toNativeType(NativeType type) if (vgGetError() != VG_NO_ERROR) { sgImage->Close(); - sgImage = 0; + sgImage.reset(); } + // release stuff vgDestroyImage(dstVgImage); QEgl::eglDestroyImageKHR(QEgl::display(), eglImage); driver.Close(); - return reinterpret_cast<void*>(sgImage); + return reinterpret_cast<void*>(sgImage.take()); #endif } else if (type == QPixmapData::FbsBitmap) { CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap); |