From 3e7c8cf1a4cd9ea86fd7d1dce13e305dd09fb6fe Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Tue, 11 Sep 2012 01:54:42 +0200 Subject: Avoiding X server leaks with XftColor cache This patch is a first complete solution to the long-standing memory leak (on the X server side) caused by repeteadly asking the server to allocate XftColor instances. Despite the fact that we were freeing them, the server didn't seem to care... this was also happening for non-Xft Colors, and solved in the same way we'd done here, i.e., by caching XftColor instances. And additional complication has been that Graphics.X11.Xft doesn't export any function to create and retain an XftColor, nor the necessary datatype constructors to write a compatible version outside the module (there's no way to construct an XftColor instance to pass to the other functions in the library). So, i've created my own lite version of the whole module, until the day it supports XftColor creation. --- xmobar.cabal | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xmobar.cabal') diff --git a/xmobar.cabal b/xmobar.cabal index c23aa1f..6fa4576 100644 --- a/xmobar.cabal +++ b/xmobar.cabal @@ -78,7 +78,7 @@ executable xmobar main-is: Main.hs other-modules: Xmobar, Config, Parsers, Commands, Localize, - XUtil, StatFS, Runnable, ColorCache, Window, + XUtil, StatFS, Runnable, ColorCache, Window Plugins, Plugins.CommandReader, Plugins.Date, Plugins.EWMH, Plugins.PipeReader, Plugins.StdinReader, Plugins.XMonadLog, Plugins.Utils, Plugins.Kbd, Plugins.Monitors, @@ -134,6 +134,7 @@ executable xmobar if flag(with_xft) || flag(all_extensions) build-depends: utf8-string == 0.3.*, X11-xft >= 0.2 && < 0.4 + other-modules: MinXft cpp-options: -DXFT if flag(with_utf8) || flag(all_extensions) -- cgit v1.2.3