diff --git a/GUI/extensions.cpp b/GUI/extensions.cpp index 8a3936a..5d94329 100644 --- a/GUI/extensions.cpp +++ b/GUI/extensions.cpp @@ -36,8 +36,9 @@ std::wstring DispatchSentenceToExtensions(std::wstring sentence, std::unordered_ { while (processing < 0) Sleep(10); processing++; - wchar_t* sentenceBuffer = new wchar_t[sentence.size() + 1]; - wcscpy(sentenceBuffer, sentence.c_str()); + wchar_t* sentenceOrigBuffer = new wchar_t[sentence.size() + 1]; + wcscpy(sentenceOrigBuffer, sentence.c_str()); + const wchar_t* sentenceBuffer = sentenceOrigBuffer; InfoForExtension* miscInfoLinkedList = new InfoForExtension; InfoForExtension* miscInfoTraverser = miscInfoLinkedList; for (auto i : miscInfo) diff --git a/GUI/extensions.h b/GUI/extensions.h index 12f8a8f..d668839 100644 --- a/GUI/extensions.h +++ b/GUI/extensions.h @@ -16,7 +16,7 @@ struct InfoForExtension int propertyValue; InfoForExtension* nextProperty; }; -typedef wchar_t*(*ExtensionFunction)(wchar_t*, InfoForExtension*); +typedef const wchar_t*(*ExtensionFunction)(const wchar_t*, InfoForExtension*); extern QComboBox* ttCombo; #endif // EXTENSIONS_H