Implement IntervalMap destructor.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 19 Nov 2010 23:28:59 +0000 (23:28 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 19 Nov 2010 23:28:59 +0000 (23:28 +0000)
Key and value objects may not be destructed instantly when they are erased from
the container, but they will be destructed eventually by the IntervalMap
destructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119873 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/IntervalMap.h

index 96b5161da7fa2b723f946068cf81138963f1ccbb..56fbe933541a12c3c9e01c57d6df58b893640264 100644 (file)
@@ -848,6 +848,11 @@ public:
     new(&rootLeaf()) RootLeaf();
   }
 
+  ~IntervalMap() {
+    clear();
+    rootLeaf().~RootLeaf();
+  }
+
   /// empty -  Return true when no intervals are mapped.
   bool empty() const {
     return rootSize == 0;