Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Commit

Permalink
Fix crash in startup when ZTS.
Browse files Browse the repository at this point in the history
  • Loading branch information
tricky committed May 20, 2010
1 parent 70d0d8b commit cea2de5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions igbinary.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,19 @@ PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("igbinary.compact_strings", "1", PHP_INI_ALL, OnUpdateBool, compact_strings, zend_igbinary_globals, igbinary_globals)
PHP_INI_END()
/* }}} */

/* {{{ php_igbinary_init_globals */
static void php_igbinary_init_globals(zend_igbinary_globals *igbinary_globals) {
igbinary_globals->compact_strings = 1;
}
/* }}} */

/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(igbinary) {
(void) type;
(void) module_number;
ZEND_INIT_MODULE_GLOBALS(igbinary, php_igbinary_init_globals, NULL);

#if HAVE_PHP_SESSION
php_session_register_serializer("igbinary",
PS_SERIALIZER_ENCODE_NAME(igbinary),
Expand All @@ -236,6 +245,11 @@ PHP_MINIT_FUNCTION(igbinary) {
PHP_MSHUTDOWN_FUNCTION(igbinary) {
(void) type;
(void) module_number;

#ifdef ZTS
ts_free_id(igbinary_globals_id);
#endif

/*
* unregister serializer?
*/
Expand Down

0 comments on commit cea2de5

Please sign in to comment.