Index: /trunk/processor/processor.m4
===================================================================
--- /trunk/processor/processor.m4	(revision 494)
+++ /trunk/processor/processor.m4	(revision 495)
@@ -764,5 +764,9 @@
 #ifdef HAVE_XCACHE_CONSTANT
 	DISPATCH(zend_uint, constinfo_cnt)
-	STRUCT_ARRAY(constinfo_cnt, xc_constinfo_t, constinfos)
+	IFRESTORE(`
+		COPY(constinfos)
+	', `
+		STRUCT_ARRAY(constinfo_cnt, xc_constinfo_t, constinfos)
+	')
 #endif
 
@@ -777,10 +781,14 @@
 	')
 	STRUCT_ARRAY(classinfo_cnt, xc_classinfo_t, classinfos)
+	popdef(`BEFORE_LOOP')
 #ifdef ZEND_ENGINE_2_1
 	DISPATCH(zend_uint, autoglobal_cnt)
-	STRUCT_ARRAY(autoglobal_cnt, xc_autoglobal_t, autoglobals)
+	IFRESTORE(`
+		COPY(autoglobals)
+	', `
+		STRUCT_ARRAY(autoglobal_cnt, xc_autoglobal_t, autoglobals)
+	')
 #endif
 	DISPATCH(zend_bool, have_early_binding)
-	popdef(`BEFORE_LOOP')
 	DISPATCH(zend_bool, have_references)
 ')
Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 494)
+++ /trunk/xcache.c	(revision 495)
@@ -1166,5 +1166,10 @@
 	} zend_end_try();
 
-	xc_free_php(&php TSRMLS_CC);
+	if (php.funcinfos) {
+		efree(php.funcinfos);
+	}
+	if (php.classinfos) {
+		efree(php.classinfos);
+	}
 
 	if (catched) {
