Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1104 closed defect (invalid)

lwgeom_homogenize does a shallow copy

Reported by: strk Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: master
Keywords: Cc:

Description

Is it intentional for lwgeom_homogenize to avoid a deep copy of coordinates ? Do we have a way to flag ownership of a collection components ?

Currently, the homogenize unit test fails with a double free of corruption as it lwgeom_free the input and the output passed to lwcollection_homogenize. How should memory be handled instead ?

Change History (2)

comment:1 by strk, 13 years ago

Resolution: invalid
Status: newclosed

Ok, I checked, lwcollection_homogenize uses lwgeom_clone, which in turn doesn't copy POINTARRAY memory (lwgeom_clone_deep would do that).

Then I guess this can't be called a bug on itself, but a general need to cleanup the memory management framework. For now I fixed the test to use lwgeom_release which supposedly does a shallow free (but still fails to drop some memory…)

comment:2 by strk, 13 years ago

For the record: r7579 is the commit which rewinded the overentusiastic memory release

Note: See TracTickets for help on using tickets.