[PATCH] D83372: Fix for memory leak reported by Valgrind

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 12:53:33 PDT 2020


beanz added a comment.

In D83372#2139641 <https://reviews.llvm.org/D83372#2139641>, @lattner wrote:

> Does this add a static constructor?


Yes it does. `std::recursive_mutex` has non-trivial constructors and destructors.

The code that was there knowingly leaked the mutex to avoid the static constructors and destructors. It should be safe to destroy it in `llvm_shutdown`, but making it a global is bad.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83372/new/

https://reviews.llvm.org/D83372





More information about the llvm-commits mailing list