Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 443)
+++ /trunk/xcache.c	(revision 444)
@@ -607,4 +607,5 @@
 	zend_uint i;
 	xc_entry_data_php_t *p = xce->data.php;
+	zend_op_array *old_active_op_array = CG(active_op_array);
 #ifndef ZEND_ENGINE_2
 	/* new ptr which is stored inside CG(class_table) */
@@ -672,4 +673,5 @@
 	free_alloca(new_cest_ptrs);
 #endif
+	CG(active_op_array) = old_active_op_array;
 	return p->op_array;
 }
@@ -1381,7 +1383,9 @@
 	else {
 		if (newlycompiled) {
+			zend_op_array *old_active_op_array = CG(active_op_array);
 			/* install it */
 			CG(active_op_array) = op_array;
 			xc_sandbox_free(&sandbox, XC_Install TSRMLS_CC);
+			CG(active_op_array) = old_active_op_array;
 		}
 	}
