improve comments

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31173 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2010-08-17 07:35:20 +00:00
parent 25ccbf3885
commit 658003a847

View file

@ -613,12 +613,21 @@ notify(NSNotificationCenter *center, NSNotificationQueueList *list,
*/ */
if (len > 0) if (len > 0)
{ {
/* First, we make a note of each notification while removing the
* corresponding list item from the queue ... so that when we get
* round to posting the notifications we will not get problems
* with another notif() trying to use the same items.
*/
for (pos = 0; pos < len; pos++) for (pos = 0; pos < len; pos++)
{ {
item = ptr[pos]; item = ptr[pos];
ptr[pos] = RETAIN(item->notification); ptr[pos] = RETAIN(item->notification);
remove_from_queue(list, item, zone); remove_from_queue(list, item, zone);
} }
/* Now that we no longer need to worry about r-entrancy,
* we step through our notifications, posting each one in turn.
*/
for (pos = 0; pos < len; pos++) for (pos = 0; pos < len; pos++)
{ {
NSNotification *n = (NSNotification*)ptr[pos]; NSNotification *n = (NSNotification*)ptr[pos];
@ -626,6 +635,7 @@ notify(NSNotificationCenter *center, NSNotificationQueueList *list,
[center postNotification: n]; [center postNotification: n];
RELEASE(n); RELEASE(n);
} }
if (allocated) if (allocated)
{ {
NSZoneFree(NSDefaultMallocZone(), ptr); NSZoneFree(NSDefaultMallocZone(), ptr);