#198 closed defect (fixed)
Missing named destructor for PreparedGeometry
Reported by: | mloskot | Owned by: | mloskot |
---|---|---|---|
Priority: | critical | Milestone: | 3.1.0 |
Component: | Core | Version: | main |
Severity: | Significant | Keywords: | PreparedGeometry destructor |
Cc: |
Description
In the wake of today thread on the mailing list: How to destroy PreparedGeometry object?, I'm reporting the lack of named destructor for PreparedGeometry as a bug.
I'm going to implement it as new static method:
static void PreparedGeometryFactory::destroy(const PreparedGeometry* geom) { delete geom; }
Change History (6)
comment:1 by , 16 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:2 by , 16 years ago
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Severity: | Unassigned → Significant |
Status: | assigned → closed |
Fixed in trunk (r2151)
After this patch, the test does not report any memory leaks for PreparedGeometry:
$ libtool --mode=execute valgrind --tool=memcheck --leak-check=yes ./geos_unit geos::geom::prep::PreparedGeometryFactory ==8147== Memcheck, a memory error detector. ==8147== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al. ==8147== Using LibVEX rev 1658, a library for dynamic binary translation. ==8147== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. ==8147== Using valgrind-3.2.1-Debian, a dynamic binary instrumentation framework. ==8147== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. ==8147== For more details, rerun with: -v ==8147== =============================== GEOS Test Suite Application =============================== geos::geom::prep::PreparedGeometryFactory: ..... 5 Tests summary: - passed: 5 ==8147== ==8147== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 21 from 1) ==8147== malloc/free: in use at exit: 0 bytes in 0 blocks. ==8147== malloc/free: 2,517 allocs, 2,517 frees, 77,521 bytes allocated. ==8147== For counts of detected errors, rerun with: -v ==8147== All heap blocks were freed -- no leaks are possible.
comment:6 by , 15 years ago
Milestone: | → 3.1.0 |
---|
Note:
See TracTickets
for help on using tickets.
The memory leak can be reproduced usign newly submitted PreparedGeometryFactoryTest (r2149) using this command: