forked from OSchip/llvm-project
Add new CrashRecoveryContextCleanup subclass: CrashRecoveryContextDeleteCleanup. This deletes the object, not just calls its destructor.
llvm-svn: 127855
This commit is contained in:
parent
7ef5cb3038
commit
fca6fd4aed
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue