Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 345)
+++ /trunk/xcache.c	(revision 353)
@@ -1324,5 +1324,4 @@
 	if (newlycompiled) {
 		xc_free_php(&php TSRMLS_CC);
-		xc_sandbox_free(&sandbox, 0 TSRMLS_CC);
 	}
 
@@ -1337,5 +1336,15 @@
 			h = NULL;
 		}
+		if (newlycompiled) {
+			xc_sandbox_free(&sandbox, 0 TSRMLS_CC);
+		}
 		return xc_compile_restore(stored_xce, h TSRMLS_CC);
+	}
+	else {
+		if (newlycompiled) {
+			/* install it */
+			CG(active_op_array) = op_array;
+			xc_sandbox_free(&sandbox, 1 TSRMLS_CC);
+		}
 	}
 	return op_array;
