Skip to content

Commit 89fed4f

Browse files
Merge pull request #10048 from adrian-prantl/32520596
Add a virtual destructor to avoid leaking the new private impl's memory.
2 parents 9a4cbc7 + efc41d9 commit 89fed4f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,6 +2074,9 @@ IRGenDebugInfo *IRGenDebugInfo::createIRGenDebugInfo(const IRGenOptions &Opts,
20742074
return new IRGenDebugInfoImpl(Opts, CI, IGM, M, SF);
20752075
}
20762076

2077+
2078+
IRGenDebugInfo::~IRGenDebugInfo() {}
2079+
20772080
// Forwarding to the private implementation.
20782081
void IRGenDebugInfo::finalize() {
20792082
static_cast<IRGenDebugInfoImpl *>(this)->finalize();

lib/IRGen/IRGenDebugInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class IRGenDebugInfo {
4949
ClangImporter &CI,
5050
IRGenModule &IGM, llvm::Module &M,
5151
SourceFile *SF);
52+
virtual ~IRGenDebugInfo();
5253

5354
/// Finalize the llvm::DIBuilder owned by this object.
5455
void finalize();

0 commit comments

Comments
 (0)