Skip to content

Commit

Permalink
[MATLAB] Issue #67 Avoiding mexCallMATLABWithTrap in director
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeandersson committed Jun 14, 2016
1 parent 0763f39 commit 4b62f60
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Lib/matlab/director.swg
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ namespace Swig {

# define SWIG_GUARD(mutex)


/* director base class */
class Director {
private:
Expand Down Expand Up @@ -251,11 +251,17 @@ namespace Swig {
mxArray* field = mxCreateString(fname.c_str());
mxArray* empty = mxCreateDoubleMatrix(0, 0, mxREAL);
mxArray* rhs[2] = {field, empty};
#ifndef HAVE_OCTAVE
mxArray* error = mexCallMATLABWithTrap(0, 0, 2, rhs, "SwigStorage");
#else
int error = mexCallMATLAB(0, 0, 2, rhs, "SwigStorage");
#endif
mxDestroyArray(field);
mxDestroyArray(empty);
if (error) {
#ifndef HAVE_OCTAVE
mxDestroyArray(error);
#endif
mexErrMsgIdAndTxt("SWIG:Director:swig_decref", "Cannot call SwigStorage");
}
}
Expand Down

0 comments on commit 4b62f60

Please sign in to comment.