]> granicus.if.org Git - php/commitdiff
@fdf crash with ZTS builds fixed (see Bug #14877)
authorHartmut Holzgraefe <hholzgra@php.net>
Wed, 28 May 2003 09:40:32 +0000 (09:40 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Wed, 28 May 2003 09:40:32 +0000 (09:40 +0000)
ext/fdf/fdf.c

index aaa0cf8b758dc99d23271a1346d1301d51a02d0d..48f18d3f0bfa52d77734ee4a05e3189f0f94850f 100644 (file)
@@ -125,10 +125,19 @@ static sapi_post_entry php_fdf_post_entry =       {
        fdf_post_handler
 };
 
+static void php_fdf_init_globals(zend_fdf_globals *fdf_globals)
+{
+       memset(fdf_globals, 0, sizeof(*fdf_globals));
+}
+
+
+
 /* {{{ PHP_MINIT_FUNCTION
  */
 PHP_MINIT_FUNCTION(fdf)
 {
+       ZEND_INIT_MODULE_GLOBALS(fdf, php_fdf_init_globals, NULL);
+
        le_fdf = zend_register_list_destructors_ex(phpi_FDFClose, NULL, "fdf", module_number);
 
        /* add handler for Acrobat FDF form post requests */
@@ -160,6 +169,7 @@ PHP_MINIT_FUNCTION(fdf)
        REGISTER_LONG_CONSTANT("FDFUp", FDFUp, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("FDFFormat", FDFFormat, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("FDFValidate", FDFValidate, CONST_CS | CONST_PERSISTENT);
+
        REGISTER_LONG_CONSTANT("FDFKeystroke", FDFKeystroke, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("FDFCalculate", FDFCalculate, CONST_CS | CONST_PERSISTENT);
 
@@ -167,7 +177,7 @@ PHP_MINIT_FUNCTION(fdf)
        REGISTER_LONG_CONSTANT("FDFNormalAP", 1, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("FDFRolloverAP", 2, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("FDFDownAP", 3, CONST_CS | CONST_PERSISTENT);
-       
+
 #ifdef PHP_WIN32
        return SUCCESS;
 #else
@@ -179,6 +189,7 @@ PHP_MINIT_FUNCTION(fdf)
 /* {{{ RINIT */
 PHP_RINIT_FUNCTION(fdf)
 {
+       FDF_G(error) = FDFErcOK;
        return SUCCESS;
 }
 /* }}} */