[PATCH 00/10] Memory leak fixes (bug 82659)

2014-11-26 Thread Peter Wu
Hi, I failed to get the git-bz integration to work (token problems?), so here are the patches by mail. The bug report (mentioned at every commit message) is https://bugs.freedesktop.org/show_bug.cgi?id=82659 These memleaks have been found using valgrind and the suppression files from GNOME.supp[1

[PATCH 07/10] daemon: properly disconnect signals, stop memleak

2014-11-26 Thread Peter Wu
Whenever the daemon is polling on a device, a new signal is connected to the object. This signal was not disconnected when polling stops which resulted in a memory leak. Furthermore, whenever the "warning-level" property is updated, the signal would result in an exponentially raising call count (th

[PATCH 09/10] daemon: release resources at shutdown

2014-11-26 Thread Peter Wu
This makes it easier to find real memory leaks with valgrind. After calling the up_backend_unplug functions, you cannot restart it with up_backend_coldplug since the lists are cleared. Tested with Linux only (not on *BSD; dummy compiles). https://bugs.freedesktop.org/show_bug.cgi?id=82659 --- sr

[PATCH 03/10] daemon: fix memleaks in GetStatistics and GetHistory

2014-11-26 Thread Peter Wu
dbus_g_method_return[_error] does not claim the passed parameters, the caller must free it theirselves. complex is filled with an GValueArray pointer (see UP_DBUS_STRUCT_DOUBLE_DOUBLE) but its contents are not freed (memleak!). This patch introduces a deprecation warning due to the use g_value_arr

[PATCH 10/10] daemon: fix dbus proxy leak on shutdown

2014-11-26 Thread Peter Wu
Fixes leaking some DBus objects on shutdown, causing noise in gobject-list and valgrind logs. https://bugs.freedesktop.org/show_bug.cgi?id=82659 --- src/up-main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/up-main.c b/src/up-main.c index cb835b7..25f16d3 100644 ---

[PATCH 01/10] linux: fix memleak when reading critical action

2014-11-26 Thread Peter Wu
g_variant_get for string types must be freed as documented at https://developer.gnome.org/glib/stable/gvariant-format-strings.html#gvariant-format-strings-strings Since we just want to compare it, use a pointer as documented at https://developer.gnome.org/glib/stable/gvariant-format-strings.html#gv

[PATCH 04/10] daemon: plug huge memleak in GetStatistics

2014-11-26 Thread Peter Wu
Reproducible by executing `upower -d` or by calling the DBus method org.freedesktop.UPower.Device.GetStatistics(charging). up_device_get_statistics -> up_history_get_profile_data -> up_stats_item_new. https://bugs.freedesktop.org/show_bug.cgi?id=82659 --- src/up-history.c | 2 +- 1 file cha

[PATCH 02/10] daemon: fix memleak in queue_changed_property

2014-11-26 Thread Peter Wu
The control of value is transferred to up_daemon_queue_changed_property, let it release the memory when an error occurs. https://bugs.freedesktop.org/show_bug.cgi?id=82659 --- src/up-daemon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/up-daemon.c b/src/up-daemon.c

[PATCH 08/10] daemon: fix various reference leaks

2014-11-26 Thread Peter Wu
up_daemon_get_daemon takes a reference on UpDaemon, so it must be properly dereferenced. Similar for up_daemon_get_devices_list which references an UpDeviceList. The display device was allocated in init, but never released either. https://bugs.freedesktop.org/show_bug.cgi?id=82659 --- src/linux/

[PATCH 05/10] daemon: fix memleak in org.freedesktop.UPower.Wakeups.GetData

2014-11-26 Thread Peter Wu
up_wakeups_get_cmdline returns allocated memory and up_wakeup_item_set_cmdline duplicates it. Therefore free the former after setting it on the item. https://bugs.freedesktop.org/show_bug.cgi?id=82659 --- src/up-wakeups.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src

[PATCH 06/10] hidpp: fix memleak for each Feature

2014-11-26 Thread Peter Wu
The name of each Logitech HID++ 2.0 Feature will now be freed. https://bugs.freedesktop.org/show_bug.cgi?id=82659 --- src/linux/hidpp-device.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/linux/hidpp-device.c b/src/linux/hidpp-device.c index 106f55a..9a651

Re: [PATCH 00/10] Memory leak fixes (bug 82659)

2014-11-26 Thread Richard Hughes
On 26 November 2014 at 11:21, Peter Wu wrote: > These memleaks have been found using valgrind and the suppression files > from GNOME.supp[1] and gobject-list with trace patches[2]. All pushed to master, thanks! Richard. ___ devkit-devel mailing list de

GUsb 0.2.2 released!

2014-11-26 Thread Richard Hughes
GUsb is a GObject wrapper for libusb1 that makes it easy to do asynchronous control, bulk and interrupt transfers with proper cancellation and integration into a mainloop. Version 0.2.2 ~ Released: 2014-11-26 New Features: - Official Windows support! Bugfixes: - No longer require G