Add new CrashRecoveryContextCleanup subclass: CrashRecoveryContextDeleteCleanup. This deletes the object, not just calls its destructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127855 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2011-03-18 03:04:18 +00:00
parent 49ab1207df
commit 0597234028

View File

@ -116,7 +116,19 @@ public:
resource->~T();
}
};
template <typename T>
class CrashRecoveryContextDeleteCleanup
: public CrashRecoveryContextCleanup
{
T *resource;
public:
CrashRecoveryContextDeleteCleanup(T *resource) : resource(resource) {}
virtual void recoverResources() {
delete resource;
}
};
template <typename T>
struct CrashRecoveryContextTrait {
static inline CrashRecoveryContextCleanup *createCleanup(T *resource) {