[maemo-commits] [maemo-commits] r15526 - in projects/haf/trunk/maemo-launcher: . debian launcher

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu May 8 13:44:42 EEST 2008
Author: guillem
Date: 2008-05-08 13:44:41 +0300 (Thu, 08 May 2008)
New Revision: 15526

Modified:
   projects/haf/trunk/maemo-launcher/ChangeLog
   projects/haf/trunk/maemo-launcher/debian/changelog
   projects/haf/trunk/maemo-launcher/launcher/launcher.c
Log:
Destroy and store state only for valid childs

(Fixes: NB#85166)


Modified: projects/haf/trunk/maemo-launcher/ChangeLog
===================================================================
--- projects/haf/trunk/maemo-launcher/ChangeLog	2008-05-08 10:44:39 UTC (rev 15525)
+++ projects/haf/trunk/maemo-launcher/ChangeLog	2008-05-08 10:44:41 UTC (rev 15526)
@@ -1,5 +1,11 @@
 2008-05-05  Guillem Jover  <guillem.jover at nokia.com>
 
+	* launcher/launcher.c (kindergarten_destroy): Traverse the whole
+	child list and act on childs with a non-zero pid.
+	(store_state): Likewise.
+
+2008-05-05  Guillem Jover  <guillem.jover at nokia.com>
+
 	* launcher/launcher.c (child_destroy): Reset pid at the beginning.
 
 2008-05-05  Guillem Jover  <guillem.jover at nokia.com>

Modified: projects/haf/trunk/maemo-launcher/debian/changelog
===================================================================
--- projects/haf/trunk/maemo-launcher/debian/changelog	2008-05-08 10:44:39 UTC (rev 15525)
+++ projects/haf/trunk/maemo-launcher/debian/changelog	2008-05-08 10:44:41 UTC (rev 15526)
@@ -1,6 +1,7 @@
 maemo-launcher (0.29-1) UNRELEASED; urgency=low
 
   * New Upstream Release.
+    - Destroy and store state only for valid childs. (Fixes: NB#85166)
 
  -- Guillem Jover <guillem.jover at nokia.com>  Mon, 05 May 2008 16:37:08 +0300
 

Modified: projects/haf/trunk/maemo-launcher/launcher/launcher.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/launcher.c	2008-05-08 10:44:39 UTC (rev 15525)
+++ projects/haf/trunk/maemo-launcher/launcher/launcher.c	2008-05-08 10:44:41 UTC (rev 15526)
@@ -438,8 +438,9 @@
   int i;
   child_t *list = kg->list;
 
-  for (i = 0; i < kg->used; i++)
-    child_destroy(&list[i]);
+  for (i = 0; i < kg->n; i++)
+    if (list[i].pid)
+      child_destroy(&list[i]);
 
   kg->used = 0;
   kg->n = 0;
@@ -571,8 +572,11 @@
   comm_msg_put_int(msg, invoker_fd);
   comm_msg_put_int(msg, childs->used);
 
-  for (i = 0; i < childs->used; i++)
+  for (i = 0; i < childs->n; i++)
   {
+    if (!list[i].pid)
+      continue;
+
     comm_msg_put_int(msg, list[i].pid);
     comm_msg_put_int(msg, list[i].sock);
     comm_msg_put_str(msg, list[i].name);


More information about the maemo-commits mailing list