summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-12-03daemon: fix ulong/gulong typoHEADmasterPeter Wu1-1/+1
Regression in 4221835fae97f875a23d0ce449e955f2ea488bbc ("daemon: properly disconnect signals, stop memleak"). https://bugs.freedesktop.org/show_bug.cgi?id=82659 Signed-off-by: Richard Hughes <richard@hughsie.com>
2014-11-26daemon: fix dbus proxy leak on shutdownPeter Wu1-1/+3
Fixes leaking some DBus objects on shutdown, causing noise in gobject-list and valgrind logs. https://bugs.freedesktop.org/show_bug.cgi?id=82659
2014-11-26daemon: release resources at shutdownPeter Wu12-0/+158
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
2014-11-26daemon: fix various reference leaksPeter Wu2-3/+13
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
2014-11-26daemon: properly disconnect signals, stop memleakPeter Wu1-2/+18
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 (this happens when the battery percentage changes for example). https://bugs.freedesktop.org/show_bug.cgi?id=82659 Reported-by: Alexander Jesner <alexander@jesner.eu> Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-26hidpp: fix memleak for each FeaturePeter Wu1-1/+12
The name of each Logitech HID++ 2.0 Feature will now be freed. https://bugs.freedesktop.org/show_bug.cgi?id=82659
2014-11-26daemon: fix memleak in org.freedesktop.UPower.Wakeups.GetDataPeter Wu1-1/+4
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
2014-11-26daemon: plug huge memleak in GetStatisticsPeter Wu1-1/+1
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
2014-11-26daemon: fix memleaks in GetStatistics and GetHistoryPeter Wu1-6/+14
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_array_free, but since UP_DBUS_STRUCT_DOUBLE_DOUBLE is a GValueArray, this is unavoidable. https://bugs.freedesktop.org/show_bug.cgi?id=82659
2014-11-26daemon: fix memleak in queue_changed_propertyPeter Wu1-1/+3
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
2014-11-26linux: fix memleak when reading critical actionPeter Wu1-1/+1
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#gvariant-format-strings-pointers https://bugs.freedesktop.org/show_bug.cgi?id=82659
2014-11-18hidpp-device: avoid unaligned memory accessPeter Wu1-3/+3
Fixes a -Wcast-align warning and a -fsanitize=undefined error. https://bugs.freedesktop.org/show_bug.cgi?id=71079
2014-11-18daemon: remove unused variablePeter Wu1-1/+0
Introduced in 2e87407eb91407e64f3d23de07b9dc91735a6a49 https://bugs.freedesktop.org/show_bug.cgi?id=86144
2014-11-14daemon: Use new warning update helper functionBastien Nocera1-6/+1
Rather than the copy/paste code in commit: b9bd275890387fb35c185f37ec0ea1f2aa857818 This makes sure that the AC status is updated. https://bugs.freedesktop.org/show_bug.cgi?id=86144
2014-11-14daemon: Update display device when battery is removedBastien Nocera1-0/+3
When removing a battery, make sure to go through the batteries, and update the display device status. https://bugs.freedesktop.org/show_bug.cgi?id=86144
2014-11-14daemon: Split out updating on_battery and warning_levelBastien Nocera1-11/+18
So that we can reuse this code. https://bugs.freedesktop.org/show_bug.cgi?id=86144
2014-10-08upowerd: Fix cleanup in up_device_idevice_coldplug/finalizeNikolay Martynov1-3/+8
Under certain conditions lockdownd_client_free was called twice for same client. This caused SIGSEGV. This patch addresses this issue Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Signed-off-by: Richard Hughes <richard@hughsie.com>
2014-10-08daemon: Update aggregate device on battery removalEvangelos Foutras1-0/+7
https://bugs.freedesktop.org/show_bug.cgi?id=84345 Signed-off-by: Richard Hughes <richard@hughsie.com>
2014-10-08all: convert value from g_get_real_time() to secondsEvangelos Foutras10-12/+12
Commit 5ddfe0d (all: Use g_get_real_time() when possible) replaced calls to g_get_current_time() with g_get_real_time(), however, we also need to convert the return value from microseconds to seconds. Signed-off-by: Richard Hughes <richard@hughsie.com>
2014-09-24all: Use g_get_real_time() when possibleBastien Nocera9-37/+16
Instead of a call to g_get_current_time().
2014-09-24daemon: Set update-time on the aggregate deviceBastien Nocera1-1/+5
2014-09-16Correct check to prevent the display of invalid ASCII codesEric Koegel1-1/+1
Cppcheck found it as a logical conjunction always evaluates to false: EXPR < 32 && EXPR > 126. Change the expression to an Or. https://bugs.freedesktop.org/show_bug.cgi?id=71066 Signed-off-by: Richard Hughes <richard@hughsie.com>
2014-09-16Fencepost array access errorEric Koegel1-2/+2
Array 'temp_data[100]' accessed at index 100, which is out of bounds. https://bugs.freedesktop.org/show_bug.cgi?id=71066 Signed-off-by: Richard Hughes <richard@hughsie.com>
2014-09-16Bump GLib min req to 2.34Eric Koegel1-1/+1
UPower uses g_clear_pointer several places in the code, but is available starting in 2.34. Update UPowers minimum version to match. https://bugs.freedesktop.org/show_bug.cgi?id=83850 Signed-off-by: Richard Hughes <richard@hughsie.com>
2014-09-02linux: Respect the CriticalPowerAction config optionBastien Nocera1-2/+14
It was documented, but the configuration was never actually read. https://bugs.freedesktop.org/show_bug.cgi?id=82925
2014-09-02daemon: Add helper to get string from configBastien Nocera2-0/+12
https://bugs.freedesktop.org/show_bug.cgi?id=82925
2014-09-02Linux integration tests: Split big tests into several smaller onesMartin Pitt1-19/+51
This is better design to catching regressions and problems in a more pin-pointed fashion. This also avoids having to restart the umockdev testbed due to changing the environment variables with stop/start_daemon().
2014-09-02Linux integration tests: Fix error handling for Python 3.4Martin Pitt1-1/+2
Python 3.4 changed the TestCase._outcome semantics, adjust accordingly.
2014-09-02Linux integration tests: Fix crash if there is no session D-BUSMartin Pitt1-1/+4
This can happen in CI environments without a desktop session.
2014-08-18trivial: post release version bumpRichard Hughes2-5/+5
2014-08-18Released UPower 0.99.1Richard Hughes2-1/+21
2014-08-18Free the obtained device list array after useAlexander Jesner1-0/+2
Signed-off-by: Richard Hughes <richard@hughsie.com>
2014-07-16doc: Adjust documentation for polkit removalMartin Pitt1-2/+1
2014-07-16self-test: Add missing #includeMartin Pitt1-0/+1
up-self-test.c: In function ‘up_test_history_func’: up-self-test.c:274:2: warning: implicit declaration of function ‘rmdir’ [-Wimplicit-function-declaration] rmdir (history_dir);
2014-07-16Remove polkit testsMartin Pitt3-29/+0
Complete the polkit dependency removal by also dropping it from the self tests. Unbreaks build and up-self-test again.
2014-07-14Remove polkit dependencyEric Koegel7-363/+0
With the removal of the suspend/hibernate code, there's no longer a need for upower to depend on polkit. This patch removes the old polkit code. Signed-off-by: Richard Hughes <richard@hughsie.com>
2014-06-30openbsd: Expose "capacity" and "energy-full-design" propertiesFabian Raetz1-3/+17
https://bugs.freedesktop.org/show_bug.cgi?id=80707
2014-06-24daemon: Fix possible UpHistoryItem leak on failureBastien Nocera1-0/+2
2014-06-24linux: Simplify list freeingBastien Nocera2-4/+2
2014-06-24linux: Fix small memleak on startup with Logitech devicesBastien Nocera1-2/+2
2014-05-20Do not print a critical warning when misusing up_device_set_object_path_sync()Richard Hughes1-2/+11
2014-05-07all: Remove IsDocked propertyBastien Nocera6-66/+1
Removes the deprecated (for not very long) property, before we do a 1.0 release. https://bugs.freedesktop.org/show_bug.cgi?id=78380
2014-05-07tools: Remove is-docked from up-toolBastien Nocera1-3/+1
2014-05-07linux: Remove is_docked from the integration testBastien Nocera1-1/+0
2014-05-07lib: Fix API doc for up_client_get_on_battery()Bastien Nocera1-1/+1
2014-05-07lib: Hard-code the IsDocked valueBastien Nocera1-5/+6
2014-05-07daemon: Deprecate "IsDocked" propertyBastien Nocera8-302/+5
The IsDocked property has been incorrect for a number of laptops for a while, as it thought that laptops with hybrid graphics cards were always docked. The alternative would have been to use the platform/dock_station devices, but those are only exported for ACPI docking stations. Instead, whether an external display is attached (which isn't really docking) should be checked in the same place where the policy depending on the value should be applied, such as gnome-settings-daemon. https://bugs.freedesktop.org/show_bug.cgi?id=36818
2014-04-23daemon: Fix shutdown on boot on some machinesBastien Nocera1-3/+10
On the Lenovo A600 all-in-one, there's a HCI/HID dual-mode Broadcom device which will try to get the battery level of the supplied mouse and keyboard, but will usually fail to do so. So we have a battery of type "battery" (it's not either a mouse or a keyboard, as it's supposed to handle both) but our display device battery code doesn't check whether those batteries are power supplies or not, using this "empty" (0% after the check timed out) battery in the shutdown policy. Check better for power supply devices, not all the "battery" types are power supply batteries, they might be non-power supply ones from unknown device types.
2014-04-23lib: Fix typo in g-i annotationBastien Nocera1-1/+1
Missing colon.
2014-04-22Update lid status when updating ac status.Jasper Lievisse Adriaanse1-2/+68
Signed-off-by: Richard Hughes <richard@hughsie.com>