New destructs for both classes


On Fri, May 30, 2014 at 1:59 AM, G.A. vd. Hoorn <notifications@github.com>
wrote:

> In industrial_trajectory_filters/src/add_smoothing_filter.cpp:
>
> > +	    std::string coef_name = filter_base_name_ + post;
> > +	    double coef;
> > +	    if(!nh_.getParam(coef_name, coef)){ // this order of coef exist for this base name
> > +	      ROS_INFO_STREAM("Param '" << coef_name << "' was not set. Using default filter values " );
> > +	      break;
> > +	    }
> > +	    temp_coef.push_back(coef);
> > +	  }
> > +	  filter_coef_.clear();
> > +	  for(int i=0; i<num_coef; i++){ // install the filter coefficients
> > +	    filter_coef_.push_back(temp_coef[i]);
> > +	  }
> > +	} // odd number of coef?
> > +      }
> > +    }
> > +    smoothing_filter_ = new industrial_trajectory_filters::SmoothingTrajectoryFilter(); //construct the filter
>
> This seems like it would cause a memory leak at destruction of the
> AddSmoothingFilter instance: no destructor, and smoothing_filter_ is a
> plain pointer type?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ros-industrial/industrial_core/pull/77/files#r13218567>
> .
>