Hi:

I just wanted to bring this to your attention:

In the following example code:

Mesh * mesh = new Mesh(3);
delete mesh;

The destructor of mesh is called, which through a bunch of nested
calls to parent destructors ends up calling BoundaryInfo::clear().
This calls
_boundary_node_id.clear(). In the above example, _boundary_node_id
happens to be empty. According to GCC 4.3.2, clearing an empty
container is not safe:

The following is taken from the Multimap.h file in the Std C++ library
(GCC 4.3.2)

   void
00190       erase(iterator __first, iterator __last)
00191       {
00192     // _GLIBCXX_RESOLVE_LIB_DEFECTS
00193     // 151. can't currently clear() empty container
00194     __glibcxx_check_erase_range(__first, __last);
00195     while (__first != __last)
00196     this->erase(__first++);
00197       }
00198
  void
00207       clear()
00208       { this->erase(begin(), end()); }


Regards,

Rahul

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to