Thread: Do I need to delete dynamic memory before leaving a function

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    The larch
    Join Date
    May 2006
    Posts
    3,573
    pcl::PointCloud<pcl::PointXYZRGB>::Ptr is a typedef for boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB > >. It already is a smart pointer, which means you needn't and must not try to delete it yourself. The object will be automatically deallocated when the (last) shared_ptr to this resource goes out of scope.

    Consult the manual: http://docs.pointclouds.org/trunk/classpcl_1_1_point_cloud.html
    Last edited by anon; 12-09-2011 at 10:13 AM.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Delete an element in a dynamic array?
    By beta3designs in forum C Programming
    Replies: 34
    Last Post: 08-22-2011, 03:34 AM
  2. Dynamic memory allocation for structs passed to function
    By eXcellion in forum C Programming
    Replies: 18
    Last Post: 03-30-2011, 03:30 PM
  3. Pointer/Dynamic Memory/function problem
    By Artist_of_dream in forum C++ Programming
    Replies: 17
    Last Post: 12-26-2004, 05:57 PM
  4. dynamic memory deletion via function
    By starkhorn in forum C++ Programming
    Replies: 4
    Last Post: 08-25-2004, 09:11 AM