Hello! Sorry for the delay, I was away for some days.
The initializer is due to an error - I tried to use a common pointer instead of the UniquePtr, and forgot to remove it. Unfortunately, removing it doesn’t fix the problem. No, I didn’t configure libMesh with --enable-unique-ptr. I exchanged the libMesh::UniquePtr<...> for a (deprecated) libMesh::AutoPtr<…>, just to test, but I still got the same error as before. I’ll recompile libMesh with this option, to see if it solves the problem. For what is worth, I’m using the 1.0.0pre version. Thiago > On 04 Feb 2016, at 17:12, John Peterson <jwpeter...@gmail.com> wrote: > > > > On Thu, Feb 4, 2016 at 3:54 AM, Thiago Milanetto Schlittler > <thiago...@gmail.com <mailto: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