Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.255.2.34
diff -u -p -r1.255.2.34 menu.inc
--- includes/menu.inc	1 Feb 2010 18:00:49 -0000	1.255.2.34
+++ includes/menu.inc	7 May 2010 13:30:49 -0000
@@ -779,11 +779,16 @@ function menu_tree_output($tree) {
  *   A fully loaded menu link, or NULL.  If a link is supplied, only the
  *   path to root will be included in the returned tree- as if this link
  *   represented the current page in a visible menu.
+ * @param $reset
+ *   Reset the static cache of the menu tree.
  * @return
  *   An tree of menu links in an array, in the order they should be rendered.
  */
-function menu_tree_all_data($menu_name = 'navigation', $item = NULL) {
+function menu_tree_all_data($menu_name = 'navigation', $item = NULL, $reset = FALSE) {
   static $tree = array();
+  if ($reset) {
+    $tree = array();
+  }
 
   // Use $mlid as a flag for whether the data being loaded is for the whole tree.
   $mlid = isset($item['mlid']) ? $item['mlid'] : 0;
@@ -1703,6 +1708,8 @@ function menu_rebuild() {
   // Clear the menu, page and block caches.
   menu_cache_clear_all();
   _menu_clear_page_cache();
+  // Clear the menu tree cache.
+  menu_tree_all_data('navigation', NULL, TRUE);
   
   if (defined('MAINTENANCE_MODE')) {
     variable_set('menu_rebuild_needed', TRUE);
