From 9699ec7aa20c4edfb81984aa56cce5623add1a89 Mon Sep 17 00:00:00 2001 From: Tim Harder Date: Wed, 10 Dec 2014 14:41:51 -0500 Subject: [PATCH] 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 --- libiio_if.m | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libiio_if.m b/libiio_if.m index bde9b58..1b215a3 100644 --- a/libiio_if.m +++ b/libiio_if.m @@ -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))