mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-23 03:59:12 +00:00
Add new CrashRecoveryContextCleanup subclass: CrashRecoveryContextDeleteCleanup. This deletes the object, not just calls its destructor.
llvm-svn: 127855
This commit is contained in:
parent
33eddc52d3
commit
4a4428a5bc
@ -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