Archived Forum Post

Index of archived forum posts

Question:

Memory leak from Chikat.Crypt2 class

Jan 17 '14 at 13:29

I am using following function in my code to Encode the big block of string memory leak taken place. Is anyone help me on this issue?

Function QPChilkat(ByVal s As String, ByVal charset As String) As String Dim Encodedstring As String Dim crypt As New Chilkat.Crypt2 crypt.Charset = charset crypt.UnlockComponent("****") crypt.CryptAlgorithm = "none" crypt.EncodingMode = "QP" Encodedstring = crypt.EncryptStringENC(s) QPChilkat = Encodedstring End Function

Thanks in Advance, Abhinandan Bansal


Answer

I put the code you supplied in a loop and ran it hundreds of times on a 512KB string, but I did not see a leak. I tested in VB6 with the ActiveX library.

NOTE: I had to change your code to use ChilkatCrypt2 instead of Chilkat.Crypt2 to work (no period). Is that really the exact code you are using? Also, please post code in <pre></pre> tags to make it easier to read.