Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.415.2.13
diff -u -r1.415.2.13 theme.inc
--- includes/theme.inc	16 Oct 2008 13:50:59 -0000	1.415.2.13
+++ includes/theme.inc	21 Oct 2008 21:35:08 -0000
@@ -436,7 +436,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.585.2.21
diff -u -r1.585.2.21 system.module
--- modules/system/system.module	8 Oct 2008 20:47:04 -0000	1.585.2.21
+++ modules/system/system.module	21 Oct 2008 21:36:22 -0000
@@ -839,7 +839,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)) {
@@ -923,6 +923,14 @@
     $themes_info = $themes;
   }
 
+  if ($clone) {
+    $themes_copy = array();
+    foreach ($themes_info as $key => $theme) {
+      $themes_copy[$key] = drupal_clone($theme);
+    }
+    return $themes_copy;
+  }
+
   return $themes_info;
 }
 

