From b670cb6ab0bf9efd75d0375f0e28d38d56c70931 Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Fri, 17 May 2013 17:05:23 -0600 Subject: [PATCH] Avoid annotation leaks by properly destroying NotePairs entries. The leak was added with the "note" directive (r12414). Also removed empty default constructor as unneeded. --- src/Notes.cc | 7 +++++++ src/Notes.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Notes.cc b/src/Notes.cc index 56d01c7646..1062f7fe99 100644 --- a/src/Notes.cc +++ b/src/Notes.cc @@ -132,6 +132,13 @@ Notes::clean() notes.clean(); } + +NotePairs::~NotePairs() +{ + while (!entries.empty()) + delete entries.pop_back(); +} + const char * NotePairs::find(const char *noteKey) const { diff --git a/src/Notes.h b/src/Notes.h index daa576864b..108cdcc1f5 100644 --- a/src/Notes.h +++ b/src/Notes.h @@ -122,7 +122,7 @@ public: MEMPROXY_CLASS(Entry); }; - NotePairs() {} + ~NotePairs(); /** * Append the entries of the src NotePairs list to our list. -- 2.47.2