[yaml2obj][ELF] Add a virtual destructor to the ELFYAML::Section class
authorSimon Atanasyan <simon@atanasyan.com>
Wed, 23 Apr 2014 11:10:55 +0000 (11:10 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Wed, 23 Apr 2014 11:10:55 +0000 (11:10 +0000)
to prevent memory leaks.

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

include/llvm/Object/ELFYAML.h
lib/Object/ELFYAML.cpp

index 38707776abea45b0af66c9f507dc2b81da23599e..26bfaaed6dab784b416fa17c7566825de3490f17 100644 (file)
@@ -79,6 +79,7 @@ struct Section {
   StringRef Info;
   llvm::yaml::Hex64 AddressAlign;
   Section(SectionKind Kind) : Kind(Kind) {}
+  virtual ~Section();
 };
 struct RawContentSection : Section {
   object::yaml::BinaryRef Content;
index 59d9c06f370e4e4b1b55d3809586d1b27b58f831..f7ba237883a0e1d4e9de9742c85565c243880bdb 100644 (file)
@@ -14,6 +14,9 @@
 #include "llvm/Object/ELFYAML.h"
 
 namespace llvm {
+
+ELFYAML::Section ::~Section() {}
+
 namespace yaml {
 
 void