Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 130)
+++ /trunk/xcache.c	(revision 131)
@@ -559,5 +559,7 @@
 	i = 1;
 	zend_hash_add(&EG(included_files), xce->name.str.val, xce->name.str.len+1, (void *)&i, sizeof(int), NULL);
-	zend_llist_add_element(&CG(open_files), h);
+	if (h) {
+		zend_llist_add_element(&CG(open_files), h);
+	}
 
 #ifndef ZEND_ENGINE_2
@@ -939,7 +941,6 @@
 
 	if (xc_test && stored_xce) {
-		/* no install, keep open_files too for h */
+		/* free it, no install. restore now */
 		xc_sandbox_free(&sandbox, 0 TSRMLS_CC);
-		sandbox.tmp_open_files->dtor = NULL;
 	}
 	else {
@@ -956,4 +957,5 @@
 		destroy_op_array(op_array TSRMLS_CC);
 		efree(op_array);
+		h = NULL;
 		goto restore;
 	}
Index: /trunk/utils.c
===================================================================
--- /trunk/utils.c	(revision 121)
+++ /trunk/utils.c	(revision 131)
@@ -371,5 +371,4 @@
 
 	memcpy(&OG(included_files), &EG(included_files), sizeof(EG(included_files)));
-	memcpy(&OG(open_files), &CG(open_files), sizeof(CG(open_files)));
 
 #ifdef HAVE_XCACHE_CONSTANT
@@ -388,7 +387,5 @@
 
 	TG(included_files) = &EG(included_files);
-	TG(open_files)     = &CG(open_files);
-
-	zend_llist_init(TG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_file_handle_dtor, 0);
+
 	zend_hash_init_ex(TG(included_files), 5, NULL, NULL, 0, 1);
 #ifdef HAVE_XCACHE_CONSTANT
@@ -440,9 +437,4 @@
 	i = 1;
 	zend_hash_add(&OG(included_files), sandbox->filename, strlen(sandbox->filename) + 1, (void *)&i, sizeof(int), NULL);
-	for (handle = zend_llist_get_first_ex(TG(open_files), &lpos);
-			handle;
-			handle = zend_llist_get_next_ex(TG(open_files), &lpos)) {
-		zend_llist_add_element(&OG(open_files), handle);
-	}
 }
 /* }}} */
@@ -466,5 +458,4 @@
 		TG(function_table).pDestructor = NULL;
 		TG(class_table).pDestructor = NULL;
-		TG(open_files)->dtor = NULL;
 	}
 
@@ -476,9 +467,7 @@
 	zend_hash_destroy(&TG(class_table));
 	zend_hash_destroy(TG(included_files));
-	zend_llist_destroy(TG(open_files));
 
 	/* restore orig here, as EG/CG holded tmp before */
 	memcpy(&EG(included_files), &OG(included_files), sizeof(EG(included_files)));
-	memcpy(&CG(open_files),     &OG(open_files),     sizeof(CG(open_files)));
 
 	if (sandbox->alloc) {
Index: /trunk/utils.h
===================================================================
--- /trunk/utils.h	(revision 103)
+++ /trunk/utils.h	(revision 131)
@@ -38,7 +38,5 @@
 
 	HashTable orig_included_files;
-	zend_llist orig_open_files;
 	HashTable *tmp_included_files;
-	zend_llist *tmp_open_files;
 
 #ifdef HAVE_XCACHE_CONSTANT
