diff src/unwind-prot.cc @ 10066:2cd940306a06

make unwind_protect frames local
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 06 Jan 2010 13:18:41 +0100
parents b3ab22ee8544
children cd96d29c5efa
line wrap: on
line diff
--- a/src/unwind-prot.cc
+++ b/src/unwind-prot.cc
@@ -33,42 +33,10 @@
 #include "unwind-prot.h"
 #include "utils.h"
 
-std::stack<unwind_protect::elem *> unwind_protect::elt_list;
-
-std::stack<std::pair <std::string, unwind_protect::frame_id_t> > unwind_protect::tag_list;
-
-void
-unwind_protect::begin_frame (const std::string& tag)
-{
-  tag_list.push (std::make_pair (tag, begin_frame ()));
-}
-
-void
-unwind_protect::run_frame (const std::string& tag)
+void unwind_protect_safe::gripe_exception (void)
 {
-  while (! tag_list.empty ())
-    {
-      std::pair<std::string, frame_id_t> top = tag_list.top ();
-      tag_list.pop ();
-
-      run_frame (top.second);
-      if (top.first == tag)
-        break;
-    }
-}
-
-void
-unwind_protect::discard_frame (const std::string& tag)
-{
-  while (! tag_list.empty ())
-    {
-      std::pair<std::string, frame_id_t> top = tag_list.top ();
-      tag_list.pop ();
-
-      run_frame (top.second);
-      if (top.first == tag)
-        break;
-    }
+  // FIXME: can this throw an exception?
+  error ("internal: unhandled exception in unwind_protect handler");
 }
 
 /*