Index: /trunk/src/compile.m
===================================================================
--- /trunk/src/compile.m	(revision 829)
+++ /trunk/src/compile.m	(revision 830)
@@ -25,4 +25,5 @@
 
 function compile (FctName,SubfctPath)
+hh=[];% handles of message display window
 if isempty(which('mcc'))
     msgbox_uvmat('ERROR','no Matlab compiler toolbox mcc installed')
@@ -42,6 +43,7 @@
     SubfctPath=['-I ' SubfctPath];%string indicating the option of including the path SubfctPath
 end
-disp(['mcc -m -R -nojvm -R -nodisplay -R -singleCompThread ' SubfctPath ' ' FctName '.m'])
+
 try
+    disp(['mcc -m -R -nojvm -R -nodisplay -R -singleCompThread ' SubfctPath ' ' FctName '.m'])
     eval(['mcc -m -R -nojvm -R -nodisplay -R -singleCompThread ' SubfctPath ' ' FctName '.m'])% compile the source file [FctName .m], which produces a binary file FctName and a cmd file [run_' FctName '.sh]
     system(['mv -f ' FctName ' bin/']);%move the binary file FctName to the subdir /bin
@@ -50,9 +52,10 @@
     system(['chmod +x ' FctName '.sh']); % set the cmd file to 'executable'
 catch ME
-    msgbox_uvmat('ERROR',ME.message);
+    hh=msgbox_uvmat('ERROR',ME.message);
 end
 display('** END **')
+if ~isempty(hh)
 delete(hh)
+end
 
 
-
