Force-quit by user or an unexpected error during the middle of a run can cause Matlab to crash. Need to replace mexErrMsgTxt with mexErrMsgIdAndTxt, and use mexAtExit to handle unexpected exits.
mexErrMsgIdAndTxt and mexAtExit added with v2.2.0. Don't think it's possible to really catch a force-quit in the middle of a mexfile run. Close this for now.
Force-quit by user or an unexpected error during the middle of a run can cause Matlab to crash. Need to replace mexErrMsgTxt with mexErrMsgIdAndTxt, and use mexAtExit to handle unexpected exits.