Fix bug in RefCountedBase/RefCountedBaseVPTR where the reference count was accidentally copied as part of the copy constructor. This could result in objects getting leaked because there reference count was too high.

llvm-svn: 144931
This commit is contained in:
Ted Kremenek 2011-11-17 23:02:14 +00:00
parent 7d2af13ccb
commit 5b61764405

View File

@ -46,6 +46,7 @@ namespace llvm {
public:
RefCountedBase() : ref_cnt(0) {}
RefCountedBase(const RefCountedBase &) : ref_cnt(0) {}
void Retain() const { ++ref_cnt; }
void Release() const {
@ -67,6 +68,8 @@ namespace llvm {
protected:
RefCountedBaseVPTR() : ref_cnt(0) {}
RefCountedBaseVPTR(const RefCountedBaseVPTR &) : ref_cnt(0) {}
virtual ~RefCountedBaseVPTR() {}
void Retain() const { ++ref_cnt; }