Title: [195992] trunk/Source/WebCore
Revision
195992
Author
[email protected]
Date
2016-02-01 16:46:33 -0800 (Mon, 01 Feb 2016)

Log Message

Free Colormap when XWindow is destroyed.
https://bugs.webkit.org/show_bug.cgi?id=153413

Patch by Sun-woo Nam <[email protected]> on 2016-02-01
Reviewed by Žan Doberšek.

Colormap is needed to create XWindow and it should be freed when XWindow is destroyed.
Unless Colormap is freed before destroying XWindow, memory leak is suspected.
XFreeColormap therefore is needed on X11Helper.

* platform/graphics/surfaces/glx/X11Helper.cpp: Added XFreeColormap.
(WebCore::X11Helper::destroyWindow):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (195991 => 195992)


--- trunk/Source/WebCore/ChangeLog	2016-02-02 00:45:43 UTC (rev 195991)
+++ trunk/Source/WebCore/ChangeLog	2016-02-02 00:46:33 UTC (rev 195992)
@@ -1,3 +1,17 @@
+2016-02-01  Sun-woo Nam  <[email protected]>
+
+        Free Colormap when XWindow is destroyed.
+        https://bugs.webkit.org/show_bug.cgi?id=153413
+
+        Reviewed by Žan Doberšek.
+
+        Colormap is needed to create XWindow and it should be freed when XWindow is destroyed.
+        Unless Colormap is freed before destroying XWindow, memory leak is suspected.
+        XFreeColormap therefore is needed on X11Helper.
+
+        * platform/graphics/surfaces/glx/X11Helper.cpp: Added XFreeColormap.
+        (WebCore::X11Helper::destroyWindow):
+
 2016-02-01  Tim Horton  <[email protected]>
 
         Move some SPI declarations into the appropriate SPI header

Modified: trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.cpp (195991 => 195992)


--- trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.cpp	2016-02-02 00:45:43 UTC (rev 195991)
+++ trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.cpp	2016-02-02 00:46:33 UTC (rev 195992)
@@ -290,6 +290,10 @@
     if (!display)
         return;
 
+    XWindowAttributes attribute;
+    XGetWindowAttributes(display, windowId, &attribute);
+
+    XFreeColormap(display, attribute.colormap);
     XDestroyWindow(display, windowId);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to