Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.507
diff -u -p -r1.507 theme.inc
--- includes/theme.inc	20 Aug 2009 15:18:09 -0000	1.507
+++ includes/theme.inc	20 Aug 2009 21:34:03 -0000
@@ -919,6 +919,17 @@ function theme() {
   }
   // restore path_to_theme()
   $theme_path = $temp;
+
+  // A preprocess or process function may have requested additional functions
+  // to run after the render step. Such a function can change $output,
+  // do some logging, etc.
+  if (isset($variables) && !empty($variables['postrender'])) {
+    foreach ($variables['postrender'] as $function) {
+      if (drupal_function_exists($function)) {
+        $function($output, $variables, $hook);
+      }
+    }
+  }
   return $output;
 }
 
