diff mbox

gnu: Add wmbattery

Message ID 20160513122507.127a7227@scratchpost.org
State New
Headers show

Commit Message

Danny Milosavljevic May 13, 2016, 10:25 a.m. UTC
On Mon, 4 Apr 2016 17:04:51 -0400
Kei Yamashita <kei@openmailbox.org> wrote:

> The source tarball comes from Debian. 

The wmbattery version <http://http.debian.net/debian/pool/main/w/wmbattery/wmbattery_2.50.orig.tar.gz> 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:


I added Joey Hess, the author of the program, to Cc.

@Joey Hess: what do you think?
diff mbox

Patch

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;