gnome-power-manager r2726 - in branches/gnome-2-22: . src



Author: rhughes
Date: Wed Mar 12 20:37:32 2008
New Revision: 2726
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=2726&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:
   branches/gnome-2-22/ChangeLog
   branches/gnome-2-22/src/gpm-cell-array.c

Modified: branches/gnome-2-22/src/gpm-cell-array.c
==============================================================================
--- branches/gnome-2-22/src/gpm-cell-array.c	(original)
+++ branches/gnome-2-22/src/gpm-cell-array.c	Wed Mar 12 20:37:32 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]