From: ageay Date: Mon, 27 May 2013 13:32:13 +0000 (+0000) Subject: Memory leak in python in MEDCouplingFieldDiscretization::New X-Git-Tag: V6_main_FINAL~52 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9c8fbcd3e67eb36b15eedec6b2c73d077db6bae3;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;