diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-07-12 18:22:07 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-07-12 18:22:07 +0000 |
commit | a1f17f83959123f1f599bf81f08dcdb3c3601114 (patch) | |
tree | a4c28eb95751ea95d2cc6e393ffbbca14e1d1b4a | |
parent | dc89561fecf100d6c32d73c7b009fd73e51be688 (diff) | |
download | external_llvm-a1f17f83959123f1f599bf81f08dcdb3c3601114.zip external_llvm-a1f17f83959123f1f599bf81f08dcdb3c3601114.tar.gz external_llvm-a1f17f83959123f1f599bf81f08dcdb3c3601114.tar.bz2 |
Delete StructType bodies when destroying a StructType.
Leak found by valgrind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134994 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/DerivedTypes.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/DerivedTypes.h b/include/llvm/DerivedTypes.h index 0f1e99f..acb28de 100644 --- a/include/llvm/DerivedTypes.h +++ b/include/llvm/DerivedTypes.h @@ -190,6 +190,10 @@ class StructType : public CompositeType { /// void *SymbolTableEntry; public: + ~StructType() { + delete [] ContainedTys; // Delete the body. + } + /// StructType::createNamed - This creates a named struct with no body /// specified. If the name is empty, it creates an unnamed struct, which has /// a unique identity but no actual name. |