Re: PDF_close problem
| From: | Uwe Steinmann | Date: | Thu, 07 Jan 1999 07:51:50 +0000 |
| Subject: | Re: PDF_close problem | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-3357@lists.php.net to get a copy of this message | ||
>
> I see the problem. You are using the 'id' variable a second time here:
>
> id=info->value.lval;
> pdf_info = php3_list_find(id,&type);
>
> and then returning this id. Reusing variables for two different things is
> probably not a good idea.
>
> We have a problem then. pdf_close() definitely needs to remove the entry
> from the list of open files since it does close the file. But,
> pdf_close() has no idea how to find this entry because there is no
> relationship between pdfdoc and fd.
>
> I think the solution is to either fopen() the file right in pdf_open() and
> associate fd and pdfdoc directly as a single entity, or perhaps a better
> solution would be to store the fd id in the pdfdoc struct somehow.
>
> I agree that my fix is bogus and should be fixed further. I'll let you
> play with it.
>
> -Rasmus
>
I have contacted the author of pdflib in order to convince him to take
the fclose() out of pdflib, because I thing it is the cleanest solution.
His answer was that he had planed it already. :-)
Consequently, I will wait for the next release of pdflib and leave the
PDF_close() as is for the mean time.
Uwe
--
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