Use the attribute enums to query if a function has an attribute.
[oota-llvm.git] / include / llvm / Support / CrashRecoveryContext.h
index db835e8c20489dd0f33c910d42dd9f7cca0ecfb9..4c0a5e26f00f0e80fe7d043238eead8f79457cb8 100644 (file)
@@ -186,8 +186,13 @@ public:
   }
 
   ~CrashRecoveryContextCleanupRegistrar() {
+    unregister();
+  }
+  
+  void unregister() {
     if (cleanup && !cleanup->cleanupFired)
-        cleanup->getContext()->unregisterCleanup(cleanup);
+      cleanup->getContext()->unregisterCleanup(cleanup);
+    cleanup = 0;
   }
 };
 }