Fix light demo exception when closing the window while the demo is playing 34/12734/2
Pedro Arthur [Sat, 28 Sep 2013 16:24:03 +0000 (13:24 -0300)]
Change-Id: I048f52b3f8eaacd096aa9fa8e864a400cc021a3b

scilab/modules/graphics/demos/lighting/rot_light.dem.sce
scilab/modules/graphics/demos/lighting/rot_plot3d.dem.sce

index e986823..74a0274 100644 (file)
@@ -18,12 +18,15 @@ function demo_rot_light()
     l=light();
     s=gce();
 
-    for i=0:2000
-        sleep(5);
-        x = 2*cos(i*%pi/180);
-        y = 2*sin(i*%pi/180);
-        z = 2;
-        l.position = [x y z];
+    try
+        for i=0:2000
+            sleep(5);
+            x = 2*cos(i*%pi/180);
+            y = 2*sin(i*%pi/180);
+            z = 2;
+            l.position = [x y z];
+        end
+    catch
     end
     // DEMO END
 endfunction
index 8e6bf25..160f22d 100644 (file)
@@ -19,9 +19,12 @@ function demo_rot_light()
     s=gce();
     a=gca();
 
-    for i=1:360
-        sleep(5);
-        a.rotation_angles = [70 i];
+    try
+        for i=1:360
+            sleep(5);
+            a.rotation_angles = [70 i];
+        end
+    catch
     end
     // DEMO END
 endfunction