On Thu, Feb 4, 2016 at 3:54 AM, Thiago Milanetto Schlittler < thiago...@gmail.com> wrote:
> Hello! > > I’m using a PointLocatorTree to determinate the values of a parameter > over a mesh, and it’s causing a segmentation fault at the end of the > program. I’m using it inside a class with the code below: > > class weight_parameter_function > { > protected: > // Members > libMesh::UniquePtr<libMesh::PointLocatorBase> > m_alpha_mask_point_locator_Ptr; > > // [other parameters] > > public: > > // Constructor > weight_parameter_function( libMesh::Mesh& alpha_mesh) : > m_alpha_mask_point_locator_Ptr { NULL } > > // [set up other parameters] > { > m_alpha_mask_point_locator_Ptr = > libMesh::PointLocatorBase::build(libMesh::TREE,alpha_mesh); > }; > } > > I’m using the default destructor for my object. If I try to reset the > pointer (like what is done for the MeshBase), I get a "pointer being freed > was not allocated” error, even if I can use the locator with no problems. > What am I doing wrong? > You'll have to forgive my ignorance, but what exact is the braced initializer syntax doing in the case of std::unique_ptr? Can you try simply omitting this initialization line altogether and see if that fixes the issue? By the way, you are obviously using a C++11 compiler, but do you also configure libmesh with --enable-unique-ptr? -- John ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Libmesh-users mailing list Libmesh-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-users