diff --git a/mex/sources/bytecode/bytecode.cc b/mex/sources/bytecode/bytecode.cc index e05fb853b..2ab41b456 100644 --- a/mex/sources/bytecode/bytecode.cc +++ b/mex/sources/bytecode/bytecode.cc @@ -723,6 +723,8 @@ mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) } catch (GeneralExceptionHandling &feh) { + // Release the lock on dynamic.bin for MATLAB+Windows, see #1815 + interprete.Close_SaveCode(); mexErrMsgTxt(feh.GetErrorMsg().c_str()); } } @@ -734,6 +736,8 @@ mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) } catch (GeneralExceptionHandling &feh) { + // Release the lock on dynamic.bin for MATLAB+Windows, see #1815 + interprete.Close_SaveCode(); mexErrMsgTxt(feh.GetErrorMsg().c_str()); } }