Index: post.php
===================================================================
--- post.php	(revision 14521)
+++ post.php	(working copy)
@@ -3924,32 +3924,44 @@
  *
  * @uses do_action() Calls 'clean_post_cache' on $id before adding children (if any).
  *
- * @param int $id The Post ID in the cache to clean
+ * @param int $id Optional The Post ID in the cache to clean
+ * @param array $found A list of nodes that have already been found
  */
-function clean_post_cache($id) {
+function clean_post_cache($id,$found=null) {
 	global $_wp_suspend_cache_invalidation, $wpdb;
 
 	if ( !empty($_wp_suspend_cache_invalidation) )
 		return;
 
+	if ( $found == null )
+	   $found = array();
+
 	$id = (int) $id;
 
-	wp_cache_delete($id, 'posts');
-	wp_cache_delete($id, 'post_meta');
+	if ( array_key_exists($id,$found) )
+	     	return;
 
-	clean_object_term_cache($id, 'post');
+	$found[$id] = true;
 
-	wp_cache_delete( 'wp_get_archives', 'general' );
-
-	do_action('clean_post_cache', $id);
-
 	if ( $children = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d", $id) ) ) {
 		foreach( $children as $cid )
 			clean_post_cache( $cid );
 	}
 
-	if ( is_multisite() )
-		wp_cache_delete( $wpdb->blogid . '-' . $id, 'global-posts' );
+	foreach ( $found as $id => $val ) 
+	{
+		wp_cache_delete($id, 'posts');
+		wp_cache_delete($id, 'post_meta');
+
+		clean_object_term_cache($id, 'post');
+
+		wp_cache_delete( 'wp_get_archives', 'general' );
+
+		do_action('clean_post_cache', $id);
+
+		if ( is_multisite() )
+		     	wp_cache_delete( $wpdb->blogid . '-' . $id, 'global-posts' );
+	}
 }
 
 /**
