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 | 2d335436f31c129f569ffea0261a94d6d3334657 (patch) | |
tree | e515bc29f3cccc0027f8e84d74fe64eba7d5f539 /llvm/lib | |
parent | 59002dc97349d41122d7a30b207a14d27ba550f2 (diff) | |
download | bcm5719-llvm-2d335436f31c129f569ffea0261a94d6d3334657.tar.gz bcm5719-llvm-2d335436f31c129f569ffea0261a94d6d3334657.zip |
Really fix the leak in the attributes list. Thanks to Benjamin Kramer for pointing out how I was being stupid.
llvm-svn: 118588
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/Attributes.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Attributes.cpp b/llvm/lib/VMCore/Attributes.cpp index c9240e534c7..37a217fc8c5 100644 --- a/llvm/lib/VMCore/Attributes.cpp +++ b/llvm/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; } |