From: Benjamin Kramer Date: Sat, 14 Jan 2012 17:10:59 +0000 (+0000) Subject: Destroy OverloadCandidates before taking away the underlying memory. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=527610d92b4becc41b8611fbc3952d727f7cac12;p=clang Destroy OverloadCandidates before taking away the underlying memory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148190 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Sema/Overload.h b/include/clang/Sema/Overload.h index 6865b85f82..b1f337dd60 100644 --- a/include/clang/Sema/Overload.h +++ b/include/clang/Sema/Overload.h @@ -707,6 +707,10 @@ namespace clang { public: OverloadCandidateSet(SourceLocation Loc) : NumInlineSequences(0), Loc(Loc){} + ~OverloadCandidateSet() { + // Destroy OverloadCandidates before the allocator is destroyed. + Candidates.clear(); + } SourceLocation getLocation() const { return Loc; }