[gnome-settings-daemon/wip/settings-relocation: 1/10] wacom: Handle NULL areas from devices
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/wip/settings-relocation: 1/10] wacom: Handle NULL areas from devices
- Date: Thu, 18 Dec 2014 17:09:33 +0000 (UTC)
commit f27102753126f6b34adb24df89d23748371bba79
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Nov 21 12:23:26 2014 +0100
wacom: Handle NULL areas from devices
This function may return NULL under certain error circumstances, so at
least avoid a crash when this gets to happen.
plugins/wacom/gsd-wacom-manager.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index 786a601..2fa9725 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -322,14 +322,17 @@ set_area (GsdWacomDevice *device,
property.data.i[3] == -1) {
gint *area;
area = gsd_wacom_device_get_default_area (device);
- property.data.i = area;
- g_debug ("Resetting area to: %d, %d, %d, %d",
- property.data.i[0],
- property.data.i[1],
- property.data.i[2],
- property.data.i[3]);
- wacom_set_property (device, &property);
- g_free (area);
+
+ if (area) {
+ property.data.i = area;
+ g_debug ("Resetting area to: %d, %d, %d, %d",
+ property.data.i[0],
+ property.data.i[1],
+ property.data.i[2],
+ property.data.i[3]);
+ wacom_set_property (device, &property);
+ g_free (area);
+ }
} else {
g_debug ("Setting area to: %d, %d, %d, %d",
property.data.i[0],
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]