diff options
author | Owen Anderson <resistor@mac.com> | 2010-11-09 17:46:38 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-11-09 17:46:38 +0000 |
commit | d35b1a2f21b9707a501563d8e4216204bb17dbb8 (patch) | |
tree | 9d55c9d343d1f6903c966c0b75376fe5fb7cc09a | |
parent | d92354c5742ea72abd3039cda5be37cc757d47d2 (diff) |
Really fix the leak in the attributes list. Thanks to Benjamin Kramer for pointing out how I was being stupid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118588 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/Attributes.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp index c9240e534c..37a217fc8c 100644 --- a/lib/VMCore/Attributes.cpp +++ b/lib/VMCore/Attributes.cpp @@ -131,8 +131,8 @@ public: } void DropRef() { sys::SmartScopedLock<true> Lock(*ALMutex); - sys::cas_flag old = RefCount++; - if (old == 1) + sys::cas_flag new_val = RefCount--; + if (new_val == 0) delete this; } |