Opened 23 years ago

Closed 23 years ago

Last modified 23 years ago

#40 closed defect (fixed)

PHP_MAPSCRIPT - shapefileObj->free() does not close file

Reported by: dmorissette Owned by: dmorissette
Priority: high Milestone:
Component: MapScript-PHP Version: 3.5
Severity: normal Keywords:
Cc:

Description

With PHP 4.0.6, a call to shpfile->free() does not close the file immediately, 
and this has the side-effect that a script that creates a temporary shapefile 
cannot reuse it until the next script execution.

This can be reproduced using test_writeshape.phtml, after adding error_log() 
messages in the PHP script, and a msDebug() call in mapscript_i.c: 
shapefileObj_destroy()

Note: doing 2 calls in a row to shapefile->free() will actually close the 
file... so this is definitely related to the reference counts that were added 
internally in PHP4.

Change History (1)

comment:1 by dmorissette, 23 years ago

Resolution: fixed
Status: newclosed
Fixed at the same time as bug#30 ... was related to invalid handling of 
reference counts: the shapefileObj objects started with a refcount of 2.  This 
was caused by unnecessary add_ref calls that were added to avoid invalid 
_handle_ errors.  

See bug#30 for the full fix description.
Note: See TracTickets for help on using tickets.