Index: Source/NSNotificationQueue.m
===================================================================
--- Source/NSNotificationQueue.m	(Revision 31081)
+++ Source/NSNotificationQueue.m	(Arbeitskopie)
@@ -572,62 +572,28 @@
 notify(NSNotificationCenter *center, NSNotificationQueueList *list,
   NSString *mode, NSZone *zone)
 {
-  BOOL					allocated = NO;
-  NSNotificationQueueRegistration	*buf[100];
-  NSNotificationQueueRegistration	**ptr = buf;
-  unsigned				len = sizeof(buf) / sizeof(*buf);
-  unsigned				pos = 0;
-  NSNotificationQueueRegistration	*item = list->head;
+  NSNotificationQueueRegistration	*item, *next;
 
-  /* Gather matching items into a buffer.
-   */
-  while (item != 0)
+  for (item = list->head; item != 0; item = next)
     {
       if (mode == nil || [item->modes indexOfObject: mode] != NSNotFound)
 	{
-	  if (pos == len)
-	    {
-	      unsigned	want;
-
-	      want = (len == 0) ? 2 : len * 2;
-	      if (NO == allocated)
-		{
-		  void		*tmp;
-		  
-		  tmp = NSZoneMalloc(NSDefaultMallocZone(),
-		    want * sizeof(void*));
-		  memcpy(tmp, (void*)ptr, len * sizeof(void*));
-		  ptr = tmp;
-		  allocated = YES;
-		}
-	      else
-		{
-		  ptr = NSZoneRealloc(NSDefaultMallocZone(),
-		    ptr, want * sizeof(void*));
-		}
-	      len = want;
-	    }
-	  ptr[pos++] = item;
-	}
-      item = item->next;	// head --> tail uses next link
-    }
-  len = pos;	// Number of items found
-
-  if (len > 0)
-    {
-      for (pos = 0; pos < len; pos++)
-	{
 	  NSNotification	*notification;
 
-	  item = ptr[pos];
 	  notification = RETAIN(item->notification);
 	  remove_from_queue(list, item, zone);
 	  [center postNotification: notification];
 	  RELEASE(notification);
+	  /* NB Start again at the head of the queue since the notifiee
+	   *    may recursively enter the event loop and remove elements
+	   *    from the queue.
+	   * FIXME Might improve performance by caching the next element pointer
+	   */
+	  next = list->head;
 	}
-      if (allocated)
+      else
 	{
-	  NSZoneFree(NSDefaultMallocZone(), ptr);
+	  next = item->next;
 	}
     }
 }
