gnome-power-manager r2725 - in trunk: . src



Author: rhughes
Date: Wed Mar 12 20:36:48 2008
New Revision: 2725
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=2725&view=rev

Log:
2008-03-12  Richard Hughes  <richard hughsie com>

* src/gpm-cell-array.c: (gpm_cell_array_collection_changed):
Don't try to generate a config_id when we have no primary batteries.
Fixes a segfault in gdm2 (#522078)


Modified:
   trunk/ChangeLog
   trunk/src/gpm-cell-array.c

Modified: trunk/src/gpm-cell-array.c
==============================================================================
--- trunk/src/gpm-cell-array.c	(original)
+++ trunk/src/gpm-cell-array.c	Wed Mar 12 20:36:48 2008
@@ -730,6 +730,14 @@
 {
 	GpmCellUnit *unit;
 	gchar *config_id;
+	guint length;
+
+	length = cell_array->priv->array->len;
+	/* if we have no devices, don't try to get refresh anything */
+	if (length == 0) {
+		gpm_debug ("no devices of type");
+		return FALSE;
+	}
 
 	unit = &(cell_array->priv->unit);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]