Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Add a fresh pointer member inside Point_set_scene_item class, Heap corruption when destruction

Subject: CGAL users discussion list

List archive

[cgal-discuss] Add a fresh pointer member inside Point_set_scene_item class, Heap corruption when destruction


Chronological Thread 
  • From: cmodel <>
  • To:
  • Subject: [cgal-discuss] Add a fresh pointer member inside Point_set_scene_item class, Heap corruption when destruction
  • Date: Mon, 20 Dec 2010 19:51:49 -0800 (PST)

Here is the issue, I tried adding one pointer member, like std::vector *m_point2; inside Point_set_scene_item class, typedef CGAL::Triangulation_2 Triangulation2; typedef Triangulation2::Face_handle Face_handle; typedef Triangulation2::Finite_faces_iterator Finite_faces_iterator; typedef Triangulation2::Point Point2; then in destructor, add the following: Q_ASSERT(m_point2 != NULL); delete m_point2; m_point2 = NULL; in bool Point_set_scene_item::read_xyz_point_set(std::istream& stream) code section, add the following: m_point2 = new std::vector; typedef Point_set::Point_iterator Point3_iterator; for(Point3_iterator p3_it = m_points->begin(); p3_it != m_points->end(); ++p3_it) { Point2 tmp((*p3_it).x(), (*p3_it).y()); m_point2->push_back(tmp); std::cout<< tmp.x() << ' ' << tmp.y() << std::endl; } Then build the project, run, got " heap corruption debug error ", did I use wrong memory? Please help me ..

View this message in context: Add a fresh pointer member inside Point_set_scene_item class, Heap corruption when destruction
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.16.

Top of Page