c++ builder / Indy > IndyTextEncoding()の使い方 > 2通り > メモリリークに注意
C++ Builder XE4
Indyの関数としてIndyTextEncoding()があり、その使い方の情報が二通りあることに気づいた。
enc := IndyTextEncoding(1252);
と
IndyTextEncoding(TEncoding.GetEncoding(20127))
上記のリンクで気になる部分は以下の返答。
Remy Lebeau
Posted: Dec 9, 2014 3:17 PM
Just keep in mind that TEncoding.GetEncoding() returns a new TEncoding object that needs to be freed, but the IndyTextEncoding(TEncoding) wrapper does not do that yet (I'm going to add that option soon), so make sure you are not leaking the TEncoding objects that you create.
FastMMでメモリリークを追っているうちに、TEncoding::GetEncoding()関連のリークにたどりついて、上記のリンクにたどり着いた。
TEncoding objectのポインタを一次変数に置いて、終了時にFreeするようにしないといけない。
関連記事
注意が必要な過去の記事
http://qiita.com/7of9/items/51bd31318c6e1332adbf
http://qiita.com/7of9/items/1fa350ce89d5f6cb356b
http://qiita.com/7of9/items/840d1bf4515335b52109
Author And Source
この問題について(c++ builder / Indy > IndyTextEncoding()の使い方 > 2通り > メモリリークに注意), 我々は、より多くの情報をここで見つけました https://qiita.com/7of9/items/db882fbaa4e610f7c910著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .