From: Timo Lotterbach Date: Thu, 10 May 2012 11:14:29 +0000 (+0200) Subject: X11WindowSystem: fixed memory management mismatch X-Git-Tag: ivi-layer-management_version_0_9_7_rc~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a91e350d05eb4f8ae14b9d60c3450e5b08774428;p=profile%2Fivi%2Flayer-management.git X11WindowSystem: fixed memory management mismatch a member of type XVisualInfo was created with new() operator, but was released with XFree() call which internally uses free(). XFree() was replaced with matching delete() operator calls. --- diff --git a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp index 0b85592..cdd7b05 100644 --- a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp +++ b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp @@ -63,6 +63,10 @@ X11WindowSystem::X11WindowSystem(const char* displayname, int width, int height, X11WindowSystem::~X11WindowSystem() { + if (windowVis) + { + delete windowVis; + } } XVisualInfo* X11WindowSystem::getDefaultVisual(Display *dpy) @@ -74,7 +78,7 @@ XVisualInfo* X11WindowSystem::getDefaultVisual(Display *dpy) if (!XMatchVisualInfo( dpy, 0, windowVis->depth, TrueColor, windowVis)) { LOG_ERROR("X11WindowSystem", "Error: Required visual not found\n"); - XFree(windowVis); + delete windowVis; return NULL; } } @@ -976,7 +980,7 @@ void X11WindowSystem::cleanup(){ if (windowVis) { - XFree(windowVis); + delete windowVis; } #ifdef WITH_XTHREADS