diff --git a/nglib/nglib.cpp b/nglib/nglib.cpp index 567c9873..2eae341b 100644 --- a/nglib/nglib.cpp +++ b/nglib/nglib.cpp @@ -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 m; + shared_ptr m(new Mesh, &NOOP_Deleter); MeshFromSpline2D (*(SplineGeometry2d*)geom, m, mparam); - new shared_ptr (m); // hack to keep mesh m alive - + // new shared_ptr (m); // hack to keep mesh m alive + cout << m->GetNSE() << " elements, " << m->GetNP() << " points" << endl; *mesh = (Ng_Mesh*)m.get();