summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorAntoine ELIAS <antoine.elias@esi-group.com>2021-03-08 11:25:36 +0100
committerSt├ęphane MOTTELET <stephane.mottelet@utc.fr>2021-03-08 11:50:08 +0100
commitd48c16f2bcde5931ad5b07afad35423e084b103b (patch)
tree6920e9297f0ecc30f32d8b50cd08b15af843f73e /scilab
parent13b6471b1c63b3329c7748c959adf731613fce91 (diff)
downloadscilab-d48c16f2bcde5931ad5b07afad35423e084b103b.zip
scilab-d48c16f2bcde5931ad5b07afad35423e084b103b.tar.gz
* Bug 16654 fixed: interp1 was leaking memory
http://bugzilla.scilab.org/show_bug.cgi?id=16654 Change-Id: Iabbb4d15976e97f341ce6291f137743e8bd84f1c
Diffstat (limited to 'scilab')
-rw-r--r--scilab/CHANGES.md1
-rw-r--r--scilab/modules/interpolation/sci_gateway/cpp/sci_interp.cpp12
2 files changed, 13 insertions, 0 deletions
diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md
index 4a9d975..3c27968 100644
--- a/scilab/CHANGES.md
+++ b/scilab/CHANGES.md
@@ -357,6 +357,7 @@ Bug Fixes
357* [#16622](https://bugzilla.scilab.org/16622): `inv` could no longer be overloaded for hypermatrices of decimal or complex numbers. 357* [#16622](https://bugzilla.scilab.org/16622): `inv` could no longer be overloaded for hypermatrices of decimal or complex numbers.
358* [#16623](https://bugzilla.scilab.org/16623): `rand(2,2,2)^2` yielded a wrong result instead of trying to call the `%s_p_s` overload for input hypermatrices. 358* [#16623](https://bugzilla.scilab.org/16623): `rand(2,2,2)^2` yielded a wrong result instead of trying to call the `%s_p_s` overload for input hypermatrices.
359* [#16644](https://bugzilla.scilab.org/16644): `input("message:")` yielded a wrong error message about `mprintf` in case of non-interpretable input. 359* [#16644](https://bugzilla.scilab.org/16644): `input("message:")` yielded a wrong error message about `mprintf` in case of non-interpretable input.
360* [#16654](https://bugzilla.scilab.org/16654): `interp` was leaking memory.
360 361
361 362
362### Bugs fixed in 6.1.0: 363### Bugs fixed in 6.1.0:
diff --git a/scilab/modules/interpolation/sci_gateway/cpp/sci_interp.cpp b/scilab/modules/interpolation/sci_gateway/cpp/sci_interp.cpp
index 32df139..3c3c91f 100644
--- a/scilab/modules/interpolation/sci_gateway/cpp/sci_interp.cpp
+++ b/scilab/modules/interpolation/sci_gateway/cpp/sci_interp.cpp
@@ -190,16 +190,28 @@ types::Function::ReturnValue sci_interp(types::typed_list &in, int _iRetCount, t
190 { 190 {
191 out.push_back(pDblYp1); 191 out.push_back(pDblYp1);
192 } 192 }
193 else
194 {
195 pDblYp1->killMe();
196 }
193 197
194 if (_iRetCount > 2) 198 if (_iRetCount > 2)
195 { 199 {
196 out.push_back(pDblYp2); 200 out.push_back(pDblYp2);
197 } 201 }
202 else
203 {
204 pDblYp2->killMe();
205 }
198 206
199 if (_iRetCount > 3) 207 if (_iRetCount > 3)
200 { 208 {
201 out.push_back(pDblYp3); 209 out.push_back(pDblYp3);
202 } 210 }
211 else
212 {
213 pDblYp3->killMe();
214 }
203 215
204 return types::Function::OK; 216 return types::Function::OK;
205} 217}