When loading the attached file, libcitygml crashes in CityModel::load when
doing:
delete handler;
The delete triggers ~CityGMLHandler which iterates _geometries and deletes each
of them. The problem is that _geometries contains previously deleted objects
which are now filled with garbage and crash when deleted a second time.
_geometries contains deleted objects because with the given file, when
encountering an end tag for surfaceMember or TriangulatedSurface the following
happen:
1. _currentCityObject is NULL: it was never initialized because the
WaterSurface parent of the surfaceMember is not handled by libcitygml so no
_currentCityObject is created for it
2. the else branch of the if is taken, so _currentGeometry is deleted but
remains in _geometries
Attached patch always does the removal from _geometries; it works for me but
I'm not sure it's the best solution.
All this was tested and investigated with the current SVN head.
Original issue reported on code.google.com by iacobcatalin@gmail.com on 24 Jan 2012 at 5:09
Original issue reported on code.google.com by
iacobcatalin@gmail.com
on 24 Jan 2012 at 5:09Attachments: