Archived Forum Post

Index of archived forum posts

Question:

CkHttp:GetHead deleting CkHttpRepsonse pointer

Feb 24 '14 at 17:34

I have tried both 9.41.1.73 and 9.5.0.14 versions of the VC++ Chilkat libs with this. I'm using the code from the Chilkat example, http://www.example-code.com/vcpp/http_check_size.asp, to determine the size of a file prior to download.

That all works fine but I get a bunch of memory leaks on exit even though I'm calling CkSettings::cleanupMemory() on exit of the app. If I delete the CkHttpResponse pointer when I'm finished with it, there are no memory leaks. The example doesn't delete the pointer and the documentation doesn't indicate you need to delete it. Should it be deleted? If no, why the memory leaks?

Here is the list of leaks reported:

Detected memory leaks! Dumping objects ->

{1628} normal block at 0x00646580, 11 bytes long. Data: <3001856 > 33 30 30 31 38 35 36 00 CD CD CD

{1622} normal block at 0x0065AF48, 312 bytes long. Data: <h h=""> 68 9B 48 01 CD CD CD CD C1 06 00 00 00 00 00 00

{1621} normal block at 0x0063B770, 20 bytes long. Data: <`}H H e > 60 7D 48 01 00 00 00 00 48 AF 65 00 00 CD CD CD

{1615} normal block at 0x00650570, 64 bytes long. Data: < ~H h c h c > E8 7E 48 01 00 00 00 00 68 C3 63 00 68 C3 63 00

{1599} normal block at 0x0065BE80, 280 bytes long. Data: < O > F4 BB 4F 01 CD CD CD CD A0 06 00 00 00 00 00 00

{1598} normal block at 0x0065BD28, 280 bytes long. Data: < O > F4 BB 4F 01 CD CD CD CD 9D 06 00 00 00 00 00 00

{1597} normal block at 0x0065AEE0, 40 bytes long. Data: < e e p e e > 88 AD 65 00 C8 B7 65 00 70 B6 65 00 20 B9 65 00

{1596} normal block at 0x0065BBD0, 280 bytes long. Data: < O > F4 BB 4F 01 CD CD CD CD 9A 06 00 00 00 00 00 00

{1595} normal block at 0x0065BA78, 280 bytes long. Data: < O > F4 BB 4F 01 CD CD CD CD 97 06 00 00 00 00 00 00

{1594} normal block at 0x0065B920, 280 bytes long. Data: < O > F4 BB 4F 01 CD CD CD CD 94 06 00 00 00 00 00 00

{1593} normal block at 0x0065B670, 280 bytes long. Data: < O > F4 BB 4F 01 CD CD CD CD 91 06 00 00 00 00 00 00

{1592} normal block at 0x0065B7C8, 280 bytes long. Data: < O > F4 BB 4F 01 CD CD CD CD 8E 06 00 00 00 00 00 00

{1589} normal block at 0x0065AD88, 280 bytes long. Data: < O > F4 BB 4F 01 CD CD CD CD 85 06 00 00 00 00 00 00

{1389} normal block at 0x0063C9D8, 20 bytes long. Data: <` c > 60 C8 63 00 00 00 00 00 00 00 00 00 00 00 00 00

{1388} normal block at 0x0063C918, 128 bytes long. Data: < H > EC 96 48 01 CD CD CD CD CC 04 00 00 00 00 00 00

{1387} normal block at 0x0063C8C0, 24 bytes long. Data: <t h=""> 74 9B 48 01 05 00 00 00 00 00 00 00 00 00 00 00

{1386} normal block at 0x0063C860, 32 bytes long. Data: <l n=""> 6C 05 4E 01 CD CD CD CD CB 04 00 00 00 00 00 00

{1385} normal block at 0x0063C368, 1208 bytes long. Data: < M M > D0 CD 4D 01 CD CD CD CD 10 CE 4D 01 CD CD CD CD

Object dump complete.


Answer

Yes. For any method that returns a new instance of a Chilkat object, that Chilkat object must be deleted by your application.


Answer

Ok, thanks. I don't see that specified in the example or documentation (unless I just missed it). Perhaps that would be a good thing to add.