mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-08 18:31:23 +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();
|
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>
|
template <typename T>
|
||||||
struct CrashRecoveryContextTrait {
|
struct CrashRecoveryContextTrait {
|
||||||
static inline CrashRecoveryContextCleanup *createCleanup(T *resource) {
|
static inline CrashRecoveryContextCleanup *createCleanup(T *resource) {
|
||||||
|
Loading…
Reference in New Issue
Block a user