From f63bd97f71dc90e950b62292525de124715e5322 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Mon, 30 Jul 2018 11:29:36 -0700 Subject: [PATCH] change to free --- GUI/extensions.cpp | 6 +++--- GUI/extensions.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/GUI/extensions.cpp b/GUI/extensions.cpp index da9530b..512a7f6 100644 --- a/GUI/extensions.cpp +++ b/GUI/extensions.cpp @@ -36,7 +36,7 @@ std::wstring DispatchSentenceToExtensions(std::wstring sentence, std::unordered_ { while (processing < 0) Sleep(10); processing++; - wchar_t* sentenceOrigBuffer = new wchar_t[sentence.size() + 1]; + wchar_t* sentenceOrigBuffer = (wchar_t*)malloc((sentence.size() + 1) * sizeof(wchar_t)); wcscpy(sentenceOrigBuffer, sentence.c_str()); const wchar_t* sentenceBuffer = sentenceOrigBuffer; InfoForExtension* miscInfoLinkedList = new InfoForExtension; @@ -57,7 +57,7 @@ std::wstring DispatchSentenceToExtensions(std::wstring sentence, std::unordered_ const wchar_t* prev = sentenceBuffer; sentenceBuffer = i.second(sentenceBuffer, miscInfoLinkedList); if (sentenceBuffer == nullptr) sentence = prev; - if (sentenceBuffer != prev) delete[] prev; + if (sentenceBuffer != prev) free((void*)prev); } miscInfoTraverser = miscInfoLinkedList; while (miscInfoTraverser != nullptr) @@ -68,7 +68,7 @@ std::wstring DispatchSentenceToExtensions(std::wstring sentence, std::unordered_ miscInfoTraverser = nextNode; } std::wstring newSentence = std::wstring(sentenceBuffer); - delete[] sentenceBuffer; + free((void*)sentenceBuffer); processing--; return newSentence; } diff --git a/GUI/extensions.h b/GUI/extensions.h index d668839..54eae66 100644 --- a/GUI/extensions.h +++ b/GUI/extensions.h @@ -16,7 +16,7 @@ struct InfoForExtension int propertyValue; InfoForExtension* nextProperty; }; -typedef const wchar_t*(*ExtensionFunction)(const wchar_t*, InfoForExtension*); +typedef const wchar_t*(*ExtensionFunction)(const wchar_t*, const InfoForExtension*); extern QComboBox* ttCombo; #endif // EXTENSIONS_H