only load library is it's not loaded already

This stops matlab from complaining about the library class already
existing after it's loaded previously.

Signed-off-by: Tim Harder <timothy.harder@analog.com>
master
Tim Harder 2014-12-10 14:41:51 -05:00
parent 0a75793d9d
commit 9699ec7aa2
1 changed files with 8 additions and 6 deletions

View File

@ -360,12 +360,14 @@ classdef libiio_if < handle
% Set the initialization status to fail
obj.if_initialized = 0;
% Load the libiio library
try
[notfound, warnings] = loadlibrary(obj.libname, obj.hname);
catch exception
err_msg = exception.message;
return;
% Load the libiio library
if(~libisloaded(obj.libname))
try
[notfound, warnings] = loadlibrary(obj.libname, obj.hname);
catch exception
err_msg = exception.message;
return;
end
end
if(~libisloaded(obj.libname))