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

llvm-svn: 127855
This commit is contained in:
Ted Kremenek 2011-03-18 03:04:18 +00:00
parent 33eddc52d3
commit 4a4428a5bc

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) {