From 47f0f1856f189e9e0d9540bd3f82b26f77088a7d Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 21 Mar 2011 18:37:59 +0000 Subject: [PATCH] Allow a client to clear an IntrustiveRefCntPtr (deliberately leaking the referenced object). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128007 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/IntrusiveRefCntPtr.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/llvm/ADT/IntrusiveRefCntPtr.h b/include/llvm/ADT/IntrusiveRefCntPtr.h index e6926de413a1..f195fb1de8a3 100644 --- a/include/llvm/ADT/IntrusiveRefCntPtr.h +++ b/include/llvm/ADT/IntrusiveRefCntPtr.h @@ -155,6 +155,10 @@ namespace llvm { other.Obj = Obj; Obj = tmp; } + + void resetWithoutRelease() { + Obj = 0; + } private: void retain() { if (Obj) Obj->Retain(); }