Index: wp-includes/theme.php
===================================================================
--- wp-includes/theme.php	(revision 15608)
+++ wp-includes/theme.php	(working copy)
@@ -1218,6 +1218,7 @@
 	update_option('stylesheet', $stylesheet);
 	delete_option('current_theme');
 	$theme = get_current_theme();
+	flush_rewrite_rules();
 	do_action('switch_theme', $theme);
 }
 
