Mercurial > hg > octave-lojdl
changeset 12367:4f4eb7da82d5 release-3-4-x
mex.cc (mxArray_octave_value::dup): if value can't be converted to mxArray object, create a clone of the mxArray_octave_value container
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 03 Feb 2011 01:40:00 -0500 |
parents | 3dd1b0b36f13 |
children | 3458c5bba6e5 |
files | src/ChangeLog src/mex.cc src/ov-base.cc |
diffstat | 3 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2011-02-03 John W. Eaton <jwe@octave.org> + + * ov-base.cc (octave_base_value::as_mxArray): Return 0 silently. + * mex.cc (mxArray_octave_value::dup): If value can't be + converted to mxArray object, then simply create a clone of the + mxArray_octave_value container. + 2010-02-02 Rik <octave@nomad.inbox5.com> * DLD-FUNCTIONS/eigs.cc, DLD-FUNCTIONS/qr.cc: Use testif to only run
--- a/src/mex.cc +++ b/src/mex.cc @@ -327,7 +327,13 @@ : mxArray_base (), val (ov), mutate_flag (false), id (mxUNKNOWN_CLASS), class_name (0), ndims (-1), dims (0) { } - mxArray *dup (void) const { return val.as_mxArray (); } + mxArray *dup (void) const + { + mxArray *retval = val.as_mxArray (); + + if (! retval) + retval = new mxArray_octave_value (*this); + } ~mxArray_octave_value (void) {