From b5eef8b3fe81b6ef04a18e36a02cfe243b283403 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Mon, 30 Jul 2018 00:47:09 -0700 Subject: [PATCH] free memory myself --- GUI/extensions.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GUI/extensions.cpp b/GUI/extensions.cpp index 5d94329..da9530b 100644 --- a/GUI/extensions.cpp +++ b/GUI/extensions.cpp @@ -53,7 +53,12 @@ std::wstring DispatchSentenceToExtensions(std::wstring sentence, std::unordered_ strcpy(miscInfoTraverser->propertyName, "END"); miscInfoTraverser->nextProperty = nullptr; for (auto i : extensions) + { + const wchar_t* prev = sentenceBuffer; sentenceBuffer = i.second(sentenceBuffer, miscInfoLinkedList); + if (sentenceBuffer == nullptr) sentence = prev; + if (sentenceBuffer != prev) delete[] prev; + } miscInfoTraverser = miscInfoLinkedList; while (miscInfoTraverser != nullptr) {