Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 24)
+++ /trunk/xcache.c	(revision 25)
@@ -1863,5 +1863,7 @@
 		xc_coredump_dir = NULL;
 	}
-#ifndef ZTS
+#ifdef ZTS
+	ts_free_id(xcache_globals_id);
+#else
 	xc_shutdown_globals(&xcache_globals TSRMLS_CC);
 #endif
