diff --git a/GUI/extensions.cpp b/GUI/extensions.cpp index da9530bc..512a7f63 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 d6688397..54eae664 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