create empty mesh before calling mesher (thx jwpeterson)

This commit is contained in:
Joachim Schöberl 2015-10-22 18:55:54 +02:00
parent 7cbdcf29cf
commit bdac0aee24

View File

@ -73,6 +73,9 @@ using namespace netgen;
namespace nglib
{
inline void NOOP_Deleter(void *) { ; }
// initialize, deconstruct Netgen library:
DLL_HEADER void Ng_Init ()
{
@ -510,10 +513,10 @@ namespace nglib
// MeshingParameters mparam;
mp->Transfer_Parameters();
shared_ptr<Mesh> m;
shared_ptr<Mesh> m(new Mesh, &NOOP_Deleter);
MeshFromSpline2D (*(SplineGeometry2d*)geom, m, mparam);
new shared_ptr<Mesh> (m); // hack to keep mesh m alive
// new shared_ptr<Mesh> (m); // hack to keep mesh m alive
cout << m->GetNSE() << " elements, " << m->GetNP() << " points" << endl;
*mesh = (Ng_Mesh*)m.get();