X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FCrashRecoveryContext.h;h=4c0a5e26f00f0e80fe7d043238eead8f79457cb8;hb=8b8fa7b2f403ae2f342413239c4151e075022c97;hp=db835e8c20489dd0f33c910d42dd9f7cca0ecfb9;hpb=3311d951e22b133207ed6f8e384d80f0970a7fb3;p=oota-llvm.git diff --git a/include/llvm/Support/CrashRecoveryContext.h b/include/llvm/Support/CrashRecoveryContext.h index db835e8c204..4c0a5e26f00 100644 --- a/include/llvm/Support/CrashRecoveryContext.h +++ b/include/llvm/Support/CrashRecoveryContext.h @@ -186,8 +186,13 @@ public: } ~CrashRecoveryContextCleanupRegistrar() { + unregister(); + } + + void unregister() { if (cleanup && !cleanup->cleanupFired) - cleanup->getContext()->unregisterCleanup(cleanup); + cleanup->getContext()->unregisterCleanup(cleanup); + cleanup = 0; } }; }