llvm.org GIT mirror llvm / 0597234
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 Ted Kremenek 9 years ago
1 changed file(s) with 13 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
115115 resource->~T();
116116 }
117117 };
118
118
119 template
120 class CrashRecoveryContextDeleteCleanup
121 : public CrashRecoveryContextCleanup
122 {
123 T *resource;
124 public:
125 CrashRecoveryContextDeleteCleanup(T *resource) : resource(resource) {}
126 virtual void recoverResources() {
127 delete resource;
128 }
129 };
130
119131 template
120132 struct CrashRecoveryContextTrait {
121133 static inline CrashRecoveryContextCleanup *createCleanup(T *resource) {