a patch for tasklist segfaulting...



As tasklist applet has been occassionally segfaulting, because
GwmhTask's name member was NULL, I've commited this patch to gnome-core
HEAD. I suppose this is not the nicest solution, as I haven't really
tracked down the why GwmhTask's name member is NULL, but it prevents
segmentation faults which take down the whole panel as the applet is a
library...

regards,
	jaKa

-- 

email: jaka gnu org
w3:    http://pluton.ijs.si/~jaka
? tasklist.diff
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-core/applets/tasklist/ChangeLog,v
retrieving revision 1.106
diff -u -r1.106 ChangeLog
--- ChangeLog	2001/03/05 04:06:29	1.106
+++ ChangeLog	2001/03/09 14:30:10
@@ -1,3 +1,9 @@
+2001-03-09  Jaka Mocnik  <jaka gnu org>
+
+	* tasklist/tasklist_applet.c (tasklist_task_get_label): return
+	empty string if task name is NULL. this prevents occasional
+	segfaults.
+
 2001-03-04 John Fleck <jfleck inkstain net>
 
 	* help/C/tasklist.sgml, help/C/tasklist_applet.sgml, plus
Index: tasklist_applet.c
===================================================================
RCS file: /cvs/gnome/gnome-core/applets/tasklist/tasklist_applet.c,v
retrieving revision 1.87
diff -u -r1.87 tasklist_applet.c
--- tasklist_applet.c	2001/03/02 19:24:58	1.87
+++ tasklist_applet.c	2001/03/09 14:30:14
@@ -112,6 +112,9 @@
 
 	das_string = task->gwmh_task->name;
 
+	if(!das_string)
+	  return g_strdup("");
+
 	label_len = gdk_string_width (tasklist->area->style->font, das_string);
 
 	overhead = tasklist->config.show_mini_icons ? 30 : 6;
@@ -568,8 +571,7 @@
 
 		if (task->fullwidth < 0) {
 			s = tasklist_task_get_label (task, -1, task->task_group);
-			task->fullwidth = gdk_string_width (
-				task->tasklist->area->style->font, s);
+			task->fullwidth = gdk_string_width (task->tasklist->area->style->font, s);
 			g_free (s);
 		}
 


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