mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-25 20:59:51 +00:00
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:
parent
49ab1207df
commit
0597234028
@ -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
Block a user