Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.471
diff -u -p -r1.471 theme.inc
--- includes/theme.inc	4 Apr 2009 00:58:09 -0000	1.471
+++ includes/theme.inc	14 Apr 2009 05:07:42 -0000
@@ -211,7 +211,7 @@ function theme_get_registry() {
  *   The theme registry array stored in memory
  */
 function _theme_set_registry($registry = NULL) {
-  static $theme_registry = NULL;
+  $theme_registry = &drupal_static(__FUNCTION__);
 
   if (isset($registry)) {
     $theme_registry = $registry;
@@ -443,12 +443,8 @@ function _theme_build_registry($theme, $
  * @return
  *   An array of the currently available themes.
  */
-function list_themes($refresh = FALSE) {
-  static $list = array();
-
-  if ($refresh) {
-    $list = array();
-  }
+function list_themes() {
+  $list = &drupal_static(__FUNCTION__, array());
 
   if (empty($list)) {
     $list = array();
@@ -589,7 +585,7 @@ function theme() {
   $args = func_get_args();
   $hook = array_shift($args);
 
-  static $hooks = NULL;
+  $hooks = &drupal_static(__FUNCTION__);
   if (!isset($hooks)) {
     init_theme();
     $hooks = theme_get_registry();
@@ -950,11 +946,11 @@ function theme_get_settings($key = NULL)
  * @return
  *   The value of the requested setting, NULL if the setting does not exist.
  */
-function theme_get_setting($setting_name, $refresh = FALSE) {
+function theme_get_setting($setting_name) {
   global $theme_key;
-  static $settings;
+  $settings = &drupal_static(__FUNCTION__);
 
-  if (empty($settings) || $refresh) {
+  if (empty($settings)) {
     $settings = theme_get_settings($theme_key);
 
     $themes = list_themes();
@@ -1771,7 +1767,7 @@ function _theme_table_cell($cell, $heade
  */
 function template_preprocess(&$variables, $hook) {
   global $user;
-  static $count = array();
+  $count = &drupal_static(__FUNCTION__, array());
 
   // Track run count for each hook to provide zebra striping.
   // See "template_preprocess_block()" which provides the same feature specific to blocks.
@@ -2034,7 +2030,7 @@ function template_preprocess_node(&$vari
  * @see block.tpl.php
  */
 function template_preprocess_block(&$variables) {
-  static $block_counter = array();
+  $block_counter = &drupal_static(__FUNCTION__, array());
   $variables['block'] = $variables['block']['#block'];
   // All blocks get an independent counter for each region.
   if (!isset($block_counter[$variables['block']->region])) {
Index: includes/unicode.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/unicode.inc,v
retrieving revision 1.37
diff -u -p -r1.37 unicode.inc
--- includes/unicode.inc	2 Jan 2009 22:09:53 -0000	1.37
+++ includes/unicode.inc	14 Apr 2009 05:07:42 -0000
@@ -323,7 +323,7 @@ function _mime_header_decode($matches) {
  *   array('<', '&', '"'). This affects both named and numerical entities.
  */
 function decode_entities($text, $exclude = array()) {
-  static $html_entities;
+  $html_entities = &drupal_static(__FUNCTION__);
   if (!isset($html_entities)) {
     include DRUPAL_ROOT . '/includes/unicode.entities.inc';
   }
Index: includes/xmlrpc.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/xmlrpc.inc,v
retrieving revision 1.56
diff -u -p -r1.56 xmlrpc.inc
--- includes/xmlrpc.inc	14 Jan 2009 21:13:41 -0000	1.56
+++ includes/xmlrpc.inc	14 Apr 2009 05:07:42 -0000
@@ -191,7 +191,7 @@ function xmlrpc_message_parse(&$xmlrpc_m
  *   The most recently stored $xmlrpc_message
  */
 function xmlrpc_message_set($value = NULL) {
-  static $xmlrpc_message;
+  $xmlrpc_message = &drupal_static(__FUNCTION__);
   if ($value) {
     $xmlrpc_message = $value;
   }
@@ -343,7 +343,7 @@ EOD;
 
 
 function xmlrpc_error($code = NULL, $message = NULL) {
-  static $xmlrpc_error;
+  $xmlrpc_error = &drupal_static(__FUNCTION__);
   if (isset($code)) {
     $xmlrpc_error = new stdClass();
     $xmlrpc_error->is_error = TRUE;
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.133
diff -u -p -r1.133 system.admin.inc
--- modules/system/system.admin.inc	13 Apr 2009 18:50:43 -0000	1.133
+++ modules/system/system.admin.inc	14 Apr 2009 05:07:42 -0000
@@ -288,7 +288,7 @@ function system_themes_form_submit($form
     $new_theme_list = array('garland');
   }
 
-  list_themes(TRUE);
+  drupal_static_reset('list_themes');
   menu_rebuild();
   drupal_theme_rebuild();
   drupal_set_message(t('The configuration options have been saved.'));
