Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.442
diff -u -r1.442 theme.inc
--- includes/theme.inc	20 Oct 2008 11:34:32 -0000	1.442
+++ includes/theme.inc	21 Oct 2008 21:32:10 -0000
@@ -446,7 +446,7 @@
     }
     else {
       // Scan the installation when the database should not be read.
-      $themes = _system_theme_data();
+      $themes = _system_theme_data(TRUE);
     }
 
     foreach ($themes as $theme) {
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.632
diff -u -r1.632 system.module
--- modules/system/system.module	14 Oct 2008 20:44:57 -0000	1.632
+++ modules/system/system.module	21 Oct 2008 21:34:32 -0000
@@ -1017,7 +1017,7 @@
  * @return
  *   An associative array of themes information.
  */
-function _system_theme_data() {
+function _system_theme_data($clone = FALSE) {
   static $themes_info = array();
 
   if (empty($themes_info)) {
@@ -1101,6 +1101,14 @@
     $themes_info = $themes;
   }
 
+  if ($clone) {
+    $themes_copy = array();
+    foreach ($themes_info as $key => $theme) {
+      $themes_copy[$key] = clone $theme;
+    }
+    return $themes_copy;
+  }
+
   return $themes_info;
 }
 
Index: update.php
===================================================================
RCS file: /cvs/drupal/drupal/update.php,v
retrieving revision 1.263
diff -u -r1.263 update.php
--- update.php	12 Oct 2008 04:30:05 -0000	1.263
+++ update.php	21 Oct 2008 21:31:52 -0000
@@ -498,7 +498,7 @@
 
   // Store values of expensive functions for future use.
   if (empty($themes) || empty($modules)) {
-    $themes = _system_theme_data();
+    $themes = system_theme_data();
     $modules = module_rebuild_cache();
   }
 

