From: Sukwon Suh Date: Thu, 24 Oct 2013 06:03:32 +0000 (+0900) Subject: fix memleak for emulator X-Git-Tag: submit/tizen_2.2/20131107.062147~91^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=860023678f49c88272023a0f5e6ae94e853dba45;p=framework%2Fosp%2Fuifw.git fix memleak for emulator Change-Id: I0087df7e136e7a45c9676fa1f224b6d3ef5950e8 Signed-off-by: Sukwon Suh --- diff --git a/src/graphics/opengl/FGrpEgl.cpp b/src/graphics/opengl/FGrpEgl.cpp index f829183..1c7195f 100644 --- a/src/graphics/opengl/FGrpEgl.cpp +++ b/src/graphics/opengl/FGrpEgl.cpp @@ -1622,8 +1622,8 @@ _CreateNativePixmapEx(Tizen::Graphics::Bitmap* pBitmap, Tizen::Graphics::BufferI Display* pNativeDisplay = null; Drawable nativeWindow = 0; Tizen::Graphics::_BitmapImpl* pBitmapImpl = null; - _PixmapInfo* pPixmapInfo = null; #if defined(FGRAPHICS_INTERNAL_USE_DRM) + _PixmapInfo* pPixmapInfo = null; unsigned int attachments[] = { DRI2BufferFrontLeft }; char* pDeviceName = null; char* pDriverName = null; @@ -1660,6 +1660,7 @@ _CreateNativePixmapEx(Tizen::Graphics::Bitmap* pBitmap, Tizen::Graphics::BufferI pNativeDisplay = (Display*) ecore_x_display_get(); nativeWindow = DefaultRootWindow(pNativeDisplay); +#if defined(FGRAPHICS_INTERNAL_USE_DRM) pPixmapInfo = new (std::nothrow) _PixmapInfo; if (pPixmapInfo == null) { @@ -1673,7 +1674,6 @@ _CreateNativePixmapEx(Tizen::Graphics::Bitmap* pBitmap, Tizen::Graphics::BufferI goto CATCH_02; } -#if defined(FGRAPHICS_INTERNAL_USE_DRM) DRI2CreateDrawable(pNativeDisplay, pPixmapInfo->nativePixmap); XSync(pNativeDisplay, False); @@ -1741,9 +1741,12 @@ _CreateNativePixmapEx(Tizen::Graphics::Bitmap* pBitmap, Tizen::Graphics::BufferI { goto CATCH_06; } -#endif //#if defined(FGRAPHICS_INTERNAL_USE_DRM) return (EGLNativePixmapType)pPixmapInfo->nativePixmap; +#else + return (EGLNativePixmapType)XCreatePixmap(pNativeDisplay, nativeWindow, width, height, bitsPerPixel); +#endif //#if defined(FGRAPHICS_INTERNAL_USE_DRM) + #if defined(FGRAPHICS_INTERNAL_USE_DRM) CATCH_06: @@ -1763,11 +1766,11 @@ CATCH_03: DRI2DestroyDrawable(pNativeDisplay, pPixmapInfo->nativePixmap); XFreePixmap(pNativeDisplay, pPixmapInfo->nativePixmap); //fall through -#endif CATCH_02: delete pPixmapInfo; //fall through +#endif CATCH_01: SysLog(NID_GRP, "_CreateNativePixmap failed!! pBitmap:%#x", (unsigned int)pBitmap);