From: ageay Date: Mon, 27 May 2013 13:32:13 +0000 (+0000) Subject: Memory leak in python in MEDCouplingFieldDiscretization::New X-Git-Tag: OK_270513 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=684f154b5ac971f5390ee9d43c006b215db02e1a;p=tools%2Fmedcoupling.git Memory leak in python in MEDCouplingFieldDiscretization::New --- diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py index 533763ecf..233f3e06f 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py @@ -12645,6 +12645,11 @@ class MEDCouplingBasicsTest(unittest.TestCase): a,b=m.distanceToPoint(pt) self.assertAlmostEqual(expectedDist,a,14) self.assertEqual(3,b) + # + fd=MEDCouplingFieldDiscretization.New(ON_CELLS) + self.assertEqual(24,fd.getNumberOfTuples(m)) + fd=MEDCouplingFieldDiscretization.New(ON_NODES) + self.assertEqual(26,fd.getNumberOfTuples(m)) pass def setUp(self): diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index 713971291..aac8f18ea 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -94,6 +94,7 @@ using namespace INTERP_KERNEL; %feature("autodoc", "1"); %feature("docstring"); +%newobject ParaMEDMEM::MEDCouplingFieldDiscretization::New; %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr; %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::deepCpy; %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;