Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.255.2.31
diff -u -r1.255.2.31 menu.inc
--- includes/menu.inc	27 Apr 2009 12:50:13 -0000	1.255.2.31
+++ includes/menu.inc	3 Sep 2009 12:48:08 -0000
@@ -778,11 +778,16 @@
  *   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;
@@ -1675,6 +1680,8 @@
   // 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);
   }
