Changeset 435


Ignore:
Timestamp:
2007-06-30T07:17:52+02:00 (7 years ago)
Author:
moo
Message:

copy internal table correctly, refix #59 which is broken by [429]

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r433 r435  
    16571657    int i; 
    16581658 
    1659     if (XG(internal_function_table).nTableSize == 0) { 
     1659    if (!XG(internal_table_copied)) { 
    16601660        zend_function tmp_func; 
    16611661        xc_cest_t tmp_cest; 
     
    16691669        zend_hash_copy(&XG(internal_function_table), CG(function_table), (copy_ctor_func_t) function_add_ref, &tmp_func, sizeof(tmp_func)); 
    16701670        zend_hash_copy(&XG(internal_class_table), CG(class_table), (copy_ctor_func_t) xc_zend_class_add_ref, &tmp_cest, sizeof(tmp_cest)); 
     1671 
     1672        XG(internal_table_copied) = 1; 
    16711673    } 
    16721674    if (xc_php_hcache.size && !XG(php_holds)) { 
     
    17181720    zend_hash_init_ex(&xcache_globals->internal_function_table, 1, NULL, NULL, 1, 0); 
    17191721    zend_hash_init_ex(&xcache_globals->internal_class_table,    1, NULL, NULL, 1, 0); 
    1720  
    17211722} 
    17221723/* }}} */ 
     
    17471748    } 
    17481749 
    1749     zend_hash_destroy(&xcache_globals->internal_function_table); 
    1750     zend_hash_destroy(&xcache_globals->internal_class_table); 
     1750    if (XG(internal_table_copied)) { 
     1751        zend_hash_destroy(&xcache_globals->internal_function_table); 
     1752        zend_hash_destroy(&xcache_globals->internal_class_table); 
     1753    } 
    17511754} 
    17521755/* }}} */ 
  • trunk/xcache_globals.h

    r405 r435  
    2020    HashTable internal_function_table; 
    2121    HashTable internal_class_table; 
     22    zend_bool internal_table_copied; 
    2223ZEND_END_MODULE_GLOBALS(xcache) 
    2324 
Note: See TracChangeset for help on using the changeset viewer.