gEDA-dev: Memory leak in timer code for GTK HID (PATCH)

Peter Clifton pcjc2 at cam.ac.uk
Thu Nov 30 18:39:38 EST 2006


Hi,

Going over some of my DBUS code, I spotted a memory leak in the GTK HID.

The following patch should fix it.

Index: gtkhid-main.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/hid/gtk/gtkhid-main.c,v
retrieving revision 1.25
diff -U3 -p -r1.25 gtkhid-main.c
--- gtkhid-main.c       14 Nov 2006 05:29:42 -0000      1.25
+++ gtkhid-main.c       30 Nov 2006 23:38:00 -0000
@@ -876,6 +876,7 @@ ghid_stop_timer (hidval timer)
   void *ptr = timer.ptr;
 
   gtk_timeout_remove (((GuiTimer *) ptr)->id);
+  g_free( ptr );
 }
 
 int


-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: timerpatch.patch
Type: text/x-patch
Size: 452 bytes
Desc: not available
Url : http://www.seul.org/pipermail/geda-dev/attachments/20061130/c4356d73/timerpatch.bin


More information about the geda-dev mailing list