Ticket #1104 (closed defect: invalid)

Opened 23 months ago

Last modified 23 months ago

lwgeom_homogenize does a shallow copy

Reported by: strk Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: trunk
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

Changed 23 months ago by strk

  • status changed from new to closed
  • resolution set to invalid

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...)

Changed 23 months ago by strk

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

Note: See TracTickets for help on using tickets.