fix bug 3268 : link with non existing file crashed 72/16372/2
Anais AUBERT [Wed, 15 Apr 2015 07:55:01 +0000 (09:55 +0200)]
Change-Id: I0e7125ad2e28695f28eb0742fc9acc3ad422f5d1

scilab/modules/dynamic_link/sci_gateway/cpp/sci_link.cpp

index 8b91b44..6a1e9c2 100644 (file)
@@ -154,7 +154,7 @@ types::Function::ReturnValue sci_link(types::typed_list &in, int _iRetCount, typ
         dl_genErrorMessage(L"link", iErr, pwstLibName);
 
         /* release lib if it is a new link */
-        if (iIDSharedLib == -1)
+        if ((iIDSharedLib == -1) && (iRetID != -1))
         {
             ConfigVariable::removeDynamicLibrary(iRetID);
         }