]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Add clear method to subr::sharing_stack.
authorRoland McGrath <roland@redhat.com>
Wed, 30 Sep 2009 23:15:29 +0000 (16:15 -0700)
committerRoland McGrath <roland@redhat.com>
Wed, 30 Sep 2009 23:15:29 +0000 (16:15 -0700)
libdw/ChangeLog
libdw/c++/subr.hh

index e6546ee1ad2f616fca858d1db4734bf284f0ad84..498e6ef32a8f14a26b29269f4bba8cef771d0e26 100644 (file)
@@ -1,5 +1,7 @@
 2009-09-30  Roland McGrath  <roland@redhat.com>
 
+       * c++/subr.hh (subr::sharing_stack::clear): New method.
+
        * c++/values.cc (dwarf::attr_value::what_space):
        Grok exprloc, flag_present, sec_offset.
 
index 921a79727b3b71e774e00f0e6174564d93422f7d..79e1c7559623ba36912b14bc541b09b31689487e 100644 (file)
@@ -1184,15 +1184,19 @@ namespace elfutils
        _m_size = n;
       }
 
-      inline void fini ()
+    public:
+      inline void clear ()
       {
        if (_m_head == NULL)
          assert (_m_size == 0);
        else
-         _m_head->release ();
+         {
+           _m_head->release ();
+           _m_head = NULL;
+           _m_size = 0;
+         }
       }
 
-    public:
       inline bool empty () const
       {
        return _m_head == NULL;
@@ -1254,14 +1258,14 @@ namespace elfutils
 
       inline ~sharing_stack ()
       {
-       fini ();
+       clear ();
       }
 
       inline sharing_stack &operator= (const sharing_stack &other)
       {
        if (&other != this)
          {
-           fini ();
+           clear ();
            init (other._m_head, other._m_size);
          }
        return *this;