Commit 917dcad3 authored by Davis King's avatar Davis King

Made ctrl+c detection in a mex file work more reliably in newer versions of

matlab.
parent 26524fe7
...@@ -3050,12 +3050,12 @@ namespace mex_binding ...@@ -3050,12 +3050,12 @@ namespace mex_binding
int num = static_cast<int>(pptr()-pbase()); int num = static_cast<int>(pptr()-pbase());
if (num != 0) if (num != 0)
{ {
check_for_matlab_ctrl_c();
buf[num] = 0; // null terminate the string buf[num] = 0; // null terminate the string
mexPrintf("%s",&buf[0]); mexPrintf("%s",&buf[0]);
mexEvalString("drawnow"); // flush print to screen mexEvalString("drawnow"); // flush print to screen
pbump(-num); pbump(-num);
check_for_matlab_ctrl_c();
} }
return 0; return 0;
} }
...@@ -3108,12 +3108,12 @@ namespace mex_binding ...@@ -3108,12 +3108,12 @@ namespace mex_binding
int num = static_cast<int>(pptr()-pbase()); int num = static_cast<int>(pptr()-pbase());
if (num != 0) if (num != 0)
{ {
check_for_matlab_ctrl_c();
buf[num] = 0; // null terminate the string buf[num] = 0; // null terminate the string
mexWarnMsgTxt(&buf[0]); mexWarnMsgTxt(&buf[0]);
mexEvalString("drawnow"); // flush print to screen mexEvalString("drawnow"); // flush print to screen
pbump(-num); pbump(-num);
check_for_matlab_ctrl_c();
} }
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment