Archived Forum Post

Index of archived forum posts


Crypt2 - ActiveX Memory leaks in Clarion 6.3

Dec 09 '15 at 15:24

Crypt2 - v9.5.0.54 calling DecryptEncoded inside a timer to simulate real application (communications). DecryptEncoded works in any scenario but have memory leaks when called from Clarion 6.3 a 4GL language capable of call ActiveX components.

Calling Chilkat's ActiveX DecryptEncoded inside a timer procedure using VB6.0 it's ok no leak, but when calling in a timer procedure in Clarion 6.3 it shows memory leaks (private bytes increase).

Clarion have capacity of call C# wrapped as COM. Calling DecryptEncoded inside a timer in VS2008 it begins increasing private bytes and after a few seconds it stabilizes with little variations. But when making a DLL wrapper as a COM (using Interface) and calling from Clarion it shows memory leaks. For example timer at 100ms calling DecryptEncoded twice (two lines of code) private bytes increases at 4k to 12k bytes each second.

I read in another thread that we should call Dispose to avoid this problem with Crypt2, but if I call it the C# component isn't work anymore and I have to restart the program. ActiveX don't have Dispose.

In all these four tests the ActiveX component or C# component never gave me an error. Components are amazing.

Is there any "clean up" that we should do between DecryptEncoded (or any other method) to try to avoid memory leaks?

Thank you very much.

Accepted Answer

Problem solved. Any data that returns from an external component like ActiveX should be saved to a Clarion variable to be used in others native functions.