cvs: pecl /ps ps.c
| From: | Uwe Steinmann | Date: | Thu, 13 Nov 2003 08:07:45 +0000 |
| Subject: | cvs: pecl /ps ps.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-530@lists.php.net to get a copy of this message | ||
steinm Thu Nov 13 03:07:45 2003 EDT
Modified files:
/pecl/ps ps.c
Log:
- PSDoc has been freed many times and PSFont didn't have a destructor at all.
Index: pecl/ps/ps.c
diff -u pecl/ps/ps.c:1.2 pecl/ps/ps.c:1.3
--- pecl/ps/ps.c:1.2 Wed Nov 12 12:29:55 2003
+++ pecl/ps/ps.c Thu Nov 13 03:07:44 2003
@@ -89,7 +89,7 @@
PHP_FE(ps_show_xy, NULL)
PHP_FE(ps_show2, NULL)
PHP_FE(ps_show_xy2, NULL)
-// PHP_FE(ps_continue_text, NULL)
+ PHP_FE(ps_continue_text, NULL)
PHP_FE(ps_show_boxed, NULL)
PHP_FE(ps_stringwidth, NULL) /* new parameters: [int font, float size] */
// PHP_FE(ps_set_text_pos, NULL)
@@ -217,6 +217,16 @@
*/
static void _free_ps_doc(zend_rsrc_list_entry *rsrc)
{
+ PSDoc *psdoc = (PSDoc *)rsrc->ptr;
+ PS_delete(psdoc);
+}
+/* }}} */
+
+/* {{{ _free_ps_font
+ */
+static void _free_ps_font(zend_rsrc_list_entry *rsrc)
+{
+ PSFont *psfont = (PSFont *)rsrc->ptr;
}
/* }}} */
@@ -252,7 +262,6 @@
case PS_UnknownError:
#endif
default:
- if (p !=NULL) PS_delete(p); /* clean up PSlib */
php_error(E_ERROR,"PSlib error: %s", shortmsg);
}
}
@@ -304,7 +313,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "PS Support", "enabled" );
php_info_print_table_row(2, "PSlib Version", tmp );
- php_info_print_table_row(2, "Revision", "$Revision: 1.2 $" );
+ php_info_print_table_row(2, "Revision", "$Revision: 1.3 $" );
php_info_print_table_end();
}
@@ -315,7 +324,7 @@
PHP_MINIT_FUNCTION(ps)
{
le_psdoc = zend_register_list_destructors_ex(_free_ps_doc, NULL, "ps document",
module_number);
- le_psfont = zend_register_list_destructors_ex(_free_ps_doc, NULL, "ps font",
module_number);
+ le_psfont = zend_register_list_destructors_ex(_free_ps_font, NULL, "ps font",
module_number);
REGISTER_LONG_CONSTANT("PS_LINECAP_BUTT", PS_LINECAP_BUTT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PS_LINECAP_ROUND", PS_LINECAP_ROUND, CONST_CS |
CONST_PERSISTENT);
@@ -1384,7 +1393,6 @@
}
/* }}} */
-#ifdef notimplementedyet
/* {{{ proto void ps_set_text_pos(int psdoc, double x, double y)
Sets the position of text for the next ps_show call */
PHP_FUNCTION(ps_set_text_pos)
@@ -1423,7 +1431,6 @@
RETURN_TRUE;
}
/* }}} */
-#endif
/* {{{ proto double ps_stringwidth(int psdoc, string text [, int font, double size])
Returns width of text in current font */
@@ -2295,7 +2302,6 @@
ZEND_FETCH_RESOURCE(ps, PSDoc *, arg1, -1, "ps document", le_psdoc);
- PS_delete(ps);
zend_list_delete(Z_LVAL_PP(arg1));
RETURN_TRUE;