1
0
Fork 0

refix #101, apache1 segv with non-zts php+XCache

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@429 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
This commit is contained in:
Xuefer 2007-06-22 15:11:06 +00:00
parent 4a41eef22e
commit a29a43eb1f
1 changed files with 10 additions and 3 deletions

View File

@ -1660,10 +1660,13 @@ static void xc_request_init(TSRMLS_D) /* {{{ */
zend_function tmp_func;
xc_cest_t tmp_cest;
zend_hash_init_ex(&XG(internal_function_table), 100, NULL, CG(function_table)->pDestructor, 1, 0);
zend_hash_copy(&XG(internal_function_table), CG(function_table), (copy_ctor_func_t) function_add_ref, &tmp_func, sizeof(tmp_func));
zend_hash_destroy(&XG(internal_function_table));
zend_hash_destroy(&XG(internal_class_table));
zend_hash_init_ex(&XG(internal_class_table), 10, NULL, CG(class_table)->pDestructor, 1, 0);
zend_hash_init_ex(&XG(internal_function_table), 100, NULL, CG(function_table)->pDestructor, 1, 0);
zend_hash_init_ex(&XG(internal_class_table), 10, NULL, CG(class_table)->pDestructor, 1, 0);
zend_hash_copy(&XG(internal_function_table), CG(function_table), (copy_ctor_func_t) function_add_ref, &tmp_func, sizeof(tmp_func));
zend_hash_copy(&XG(internal_class_table), CG(class_table), (copy_ctor_func_t) xc_zend_class_add_ref, &tmp_cest, sizeof(tmp_cest));
}
if (xc_php_hcache.size && !XG(php_holds)) {
@ -1711,6 +1714,10 @@ void xc_init_globals(zend_xcache_globals* xcache_globals TSRMLS_DC)
#endif
{
memset(xcache_globals, 0, sizeof(zend_xcache_globals));
zend_hash_init_ex(&xcache_globals->internal_function_table, 1, NULL, NULL, 1, 0);
zend_hash_init_ex(&xcache_globals->internal_class_table, 1, NULL, NULL, 1, 0);
}
/* }}} */
/* {{{ PHP_GSHUTDOWN_FUNCTION(xcache) */