Skip to content

Commit

Permalink
Merge pull request #951 from gcinbis/patch-1
Browse files Browse the repository at this point in the history
Lock the mex file to avoid MATLAB crashes
  • Loading branch information
shelhamer committed Oct 2, 2014
2 parents e6ba910 + 1b5ef74 commit b22b278
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions matlab/caffe/matcaffe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ static handler_registry handlers[] = {
** matlab entry point: caffe(api_command, arg1, arg2, ...)
**/
void mexFunction(MEX_ARGS) {
mexLock(); // Avoid clearing the mex file.
if (nrhs == 0) {
LOG(ERROR) << "No API command given";
mexErrMsgTxt("An API command is requires");
Expand Down

0 comments on commit b22b278

Please sign in to comment.