From: Owen Anderson Date: Tue, 9 Nov 2010 17:46:38 +0000 (+0000) Subject: Really fix the leak in the attributes list. Thanks to Benjamin Kramer for pointing... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=d35b1a2f21b9707a501563d8e4216204bb17dbb8;p=oota-llvm.git 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 --- diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp index c9240e534c7..37a217fc8c5 100644 --- a/lib/VMCore/Attributes.cpp +++ b/lib/VMCore/Attributes.cpp @@ -131,8 +131,8 @@ public: } void DropRef() { sys::SmartScopedLock Lock(*ALMutex); - sys::cas_flag old = RefCount++; - if (old == 1) + sys::cas_flag new_val = RefCount--; + if (new_val == 0) delete this; }