From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: Re: [PATCH] gnu: Add wmbattery Date: Fri, 13 May 2016 12:25:07 +0200 Message-ID: <20160513122507.127a7227@scratchpost.org> References: <20160404170451.5e21f8f0@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2M9x-0004dp-8t for guix-devel@gnu.org; Mon, 16 May 2016 13:18:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2M9h-00082d-GR for guix-devel@gnu.org; Mon, 16 May 2016 13:18:25 -0400 Received: from dd1012.kasserver.com ([85.13.128.8]:52532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2M9h-00081b-9C for guix-devel@gnu.org; Mon, 16 May 2016 13:18:09 -0400 In-Reply-To: <20160404170451.5e21f8f0@openmailbox.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Cc: Joey Hess On Mon, 4 Apr 2016 17:04:51 -0400 Kei Yamashita wrote: > The source tarball comes from Debian. The wmbattery version that we use in Guix has a memory leak. It's been eating up all memory of my laptop for some time now, so I tracked it down. The fix would be: diff -ur orig/dockapps-30b9edb/upower.c dockapps-30b9edb/upower.c --- orig/dockapps-30b9edb/upower.c 2015-08-31 01:58:13.000000000 +0200 +++ dockapps-30b9edb/upower.c 2016-05-12 07:21:27.550374114 +0200 @@ -56,7 +56,8 @@ int upower_supported(void) { - up = up_client_new(); + if (!up) + up = up_client_new(); if (!up) { return 0; @@ -78,7 +79,8 @@ GPtrArray *devices = NULL; static int retries = 0; - up = up_client_new(); + if (!up) + up = up_client_new(); if (!up) return -1; I added Joey Hess, the author of the program, to Cc. @Joey Hess: what do you think?