CVS update: php3/functions
| From: | steinm | Date: | Wed, 10 Feb 1999 10:47:17 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-4022@lists.php.net to get a copy of this message | ||
Date: Wednesday February 10, 1999 @ 5:47
Author: steinm
Update of /repository/php3/functions
In directory asf:/u/temp/cvs-serv20762/functions
Modified Files:
pdf.c
Log Message:
- fixed segm fault when memory for pdf_info was freed
- fixed set_color... functions
- fixed pdf_add_outline() (small problem now: any call to
pdf_add_outline() allocates memory which has to be freed
by the php3 memory manager. This is due to a problem with
pdflib. Can't see how to solve this in a cleaner way.)
Index: php3/functions/pdf.c
diff -c php3/functions/pdf.c:1.23 php3/functions/pdf.c:1.24
*** php3/functions/pdf.c:1.23 Fri Jan 22 14:59:56 1999
--- php3/functions/pdf.c Wed Feb 10 05:47:16 1999
***************
*** 27,33 ****
+----------------------------------------------------------------------+
*/
! /* $Id: pdf.c,v 1.23 1999/01/22 19:59:56 eschmid Exp $ */
/* pdflib 0.6 is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997 Thomas Merz. */
--- 27,33 ----
+----------------------------------------------------------------------+
*/
! /* $Id: pdf.c,v 1.24 1999/02/10 10:47:16 steinm Exp $ */
/* pdflib 0.6 is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997 Thomas Merz. */
***************
*** 382,387 ****
--- 382,397 ----
if(!pdf)
RETURN_FALSE;
+ /* Due to a problem with pdf_info() we need to get rid of it
+ right here. The problem is: When pdf_close() is called it
+ will call the pdflib function pdf_finalize() which then
+ frees the space for the struct of pdf_info. At this point the
+ elements of pdf_info still occupy space which now cannot be
+ freed anymore because the struct is already gone. Before this
+ fix, _free_pdf_info() tried to remove the elements and caused
+ an segm fault. This shouldn't happen anymore.
+ */
+ php3_list_delete(id);
id = php3_list_insert(pdf,PDF_GLOBAL(le_pdf));
RETURN_LONG(id);
}
***************
*** 1656,1661 ****
--- 1666,1673 ----
convert_to_long(arg1);
convert_to_double(arg2);
+ convert_to_double(arg3);
+ convert_to_double(arg4);
id=arg1->value.lval;
pdf = php3_list_find(id,&type);
if(!pdf || type!=PDF_GLOBAL(le_pdf)) {
***************
*** 1683,1688 ****
--- 1695,1702 ----
convert_to_long(arg1);
convert_to_double(arg2);
+ convert_to_double(arg3);
+ convert_to_double(arg4);
id=arg1->value.lval;
pdf = php3_list_find(id,&type);
if(!pdf || type!=PDF_GLOBAL(le_pdf)) {
***************
*** 1710,1715 ****
--- 1724,1731 ----
convert_to_long(arg1);
convert_to_double(arg2);
+ convert_to_double(arg3);
+ convert_to_double(arg4);
id=arg1->value.lval;
pdf = php3_list_find(id,&type);
if(!pdf || type!=PDF_GLOBAL(le_pdf)) {
***************
*** 1744,1750 ****
RETURN_FALSE;
}
! PDF_add_outline(pdf, arg2->value.str.val);
RETURN_TRUE;
}
--- 1760,1766 ----
RETURN_FALSE;
}
! PDF_add_outline(pdf, estrdup(arg2->value.str.val));
RETURN_TRUE;
}
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net