change to free
This commit is contained in:
parent
e4d74fe6ab
commit
f63bd97f71
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user