fix memory leaks
This commit is contained in:
parent
5984ae514b
commit
29eb1dcfe6
@ -33,7 +33,7 @@ std::wstring DispatchSentenceToExtensions(std::wstring sentence, std::unordered_
|
|||||||
wcscpy(sentenceBuffer, sentence.c_str());
|
wcscpy(sentenceBuffer, sentence.c_str());
|
||||||
InfoForExtension* miscInfoLinkedList = new InfoForExtension;
|
InfoForExtension* miscInfoLinkedList = new InfoForExtension;
|
||||||
InfoForExtension* miscInfoTraverser = miscInfoLinkedList;
|
InfoForExtension* miscInfoTraverser = miscInfoLinkedList;
|
||||||
for (auto& i : miscInfo) miscInfoTraverser = miscInfoTraverser->nextProperty = new InfoForExtension{ i.first.c_str(), i.second, new InfoForExtension };
|
for (auto& i : miscInfo) miscInfoTraverser = miscInfoTraverser->nextProperty = new InfoForExtension{ i.first.c_str(), i.second, nullptr };
|
||||||
extenMutex.lock_shared();
|
extenMutex.lock_shared();
|
||||||
for (auto i : extensions)
|
for (auto i : extensions)
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,7 @@ std::wstring GetTranslationUri(const wchar_t* text, unsigned int TKK)
|
|||||||
a %= 1000000;
|
a %= 1000000;
|
||||||
b ^= a;
|
b ^= a;
|
||||||
|
|
||||||
|
delete[] utf8text;
|
||||||
return std::wstring(L"/translate_a/single?client=t&dt=ld&dt=rm&dt=t&tk=") + std::to_wstring(a) + L"." + std::to_wstring(b) + L"&q=" + std::wstring(text);
|
return std::wstring(L"/translate_a/single?client=t&dt=ld&dt=rm&dt=t&tk=") + std::to_wstring(a) + L"." + std::to_wstring(b) + L"&q=" + std::wstring(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user