X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=blobdiff_plain;f=scilab%2Fmodules%2Ffunctions%2Fsci_gateway%2Fcpp%2Fsci_exec.cpp;h=fa01a405aac8a9b220477ded01d0a407b3079a1a;hp=f898a09ce849b31ca6ffa8375fe426e0e796ff3b;hb=447e05dbfd2d8874709c9781e833f8bb20a0294e;hpb=c7d8cc92725692a314d5314023496fa28f1feebc diff --git a/scilab/modules/functions/sci_gateway/cpp/sci_exec.cpp b/scilab/modules/functions/sci_gateway/cpp/sci_exec.cpp index f898a09..fa01a40 100644 --- a/scilab/modules/functions/sci_gateway/cpp/sci_exec.cpp +++ b/scilab/modules/functions/sci_gateway/cpp/sci_exec.cpp @@ -161,6 +161,7 @@ types::Function::ReturnValue sci_exec(types::typed_list &in, int _iRetCount, typ return Function::Error; } + ThreadManagement::LockParser(); parser.parseFile(pwstTemp, L"exec"); FREE(pwstTemp); if (parser.getExitStatus() != Parser::Succeded) @@ -174,6 +175,7 @@ types::Function::ReturnValue sci_exec(types::typed_list &in, int _iRetCount, typ ConfigVariable::setLastErrorNumber(999); delete parser.getTree(); mclose(iID); + ThreadManagement::UnlockParser(); return Function::OK; } @@ -183,6 +185,7 @@ types::Function::ReturnValue sci_exec(types::typed_list &in, int _iRetCount, typ delete parser.getTree(); mclose(iID); + ThreadManagement::UnlockParser(); return Function::Error; } @@ -205,6 +208,7 @@ types::Function::ReturnValue sci_exec(types::typed_list &in, int _iRetCount, typ pExp = parser.getTree(); } + ThreadManagement::UnlockParser(); // update where to set the name of the executed file. ConfigVariable::setFileNameToLastWhere(pwstFile);