diff src/graphics.cc @ 10066:2cd940306a06

make unwind_protect frames local
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 06 Jan 2010 13:18:41 +0100
parents 33ba83a06a42
children cd96d29c5efa
line wrap: on
line diff
--- a/src/graphics.cc	Tue Jan 05 13:16:16 2010 +0100
+++ b/src/graphics.cc	Wed Jan 06 13:18:41 2010 +0100
@@ -2290,10 +2290,10 @@
       // ask whether it is OK to delete the listener for the given
       // property.  How can we know in advance that it will be OK?
 
-      unwind_protect::frame_id_t uwp_frame = unwind_protect::begin_frame ();
-
-      unwind_protect::protect_var (discard_error_messages);
-      unwind_protect::protect_var (error_state);
+      unwind_protect frame;
+
+      frame.protect_var (discard_error_messages);
+      frame.protect_var (error_state);
 
       discard_error_messages = true;
 
@@ -2301,8 +2301,6 @@
 
       if (! error_state && p.ok ())
 	p.delete_listener ();
-
-      unwind_protect::run_frame (uwp_frame);
     }
 }
 
@@ -3859,7 +3857,9 @@
 
     }
 
-  unwind_protect::protect_var (updating_axis_limits);
+  unwind_protect frame;
+  frame.protect_var (updating_axis_limits);
+
   updating_axis_limits = true;
 
   switch (update_type)
@@ -3897,8 +3897,6 @@
     }
 
   xproperties.update_transform ();
-
-  unwind_protect::run ();
 }
 
 inline
@@ -4501,8 +4499,8 @@
   else
     args(1) = Matrix ();
 
-  unwind_protect::frame_id_t uwp_frame = unwind_protect::begin_frame ();
-  unwind_protect::add_fcn (gh_manager::restore_gcbo);
+  unwind_protect_safe frame;
+  frame.add_fcn (gh_manager::restore_gcbo);
 
   if (true)
     {
@@ -4551,8 +4549,6 @@
     feval (fcn, args);
   
   END_INTERRUPT_WITH_EXCEPTIONS;
-
-  unwind_protect::run_frame (uwp_frame);
 }
 
 void
@@ -5381,10 +5377,10 @@
 
   gh_manager::lock ();
 
-  unwind_protect::frame_id_t uwp_frame = unwind_protect::begin_frame ();
-  unwind_protect::protect_var (Vdrawnow_requested, false);
-
-  unwind_protect::protect_var (drawnow_executing);
+  unwind_protect frame;
+  frame.protect_var (Vdrawnow_requested, false);
+
+  frame.protect_var (drawnow_executing);
 
   if (++drawnow_executing <= 1)
     {
@@ -5519,8 +5515,6 @@
 	print_usage ();
     }
 
-  unwind_protect::run_frame (uwp_frame);
-
   gh_manager::unlock ();
 
   return retval;