Solved

VarVariant memory leak

Posted on 1998-03-06
1
435 Views
Last Modified: 2010-05-18
hi,

I'm working on Delphi 2.01, NT 4.0, NTFS. I discovered a memory leak in using VarArrayCreate with type VarVariant and assigning strings to the array. I will add a sample code as a comment (I don't have it with me right now).
I discovered the memory leak using TurboPower's "Memory Sleuth". this memory leak happens only on Delphi 2.0 (I checked it on Delphi 3.0, and it was OK). I am looking for a way to alter CLASSES.PAS or SYSTEM.PAS to prevent the leak.
I have a lot of code written so I don't want to use data structures other then VarArray, and I can't upgrade to Delphi 3.

thanks,
  Ori.
0
Comment
Question by:oris
1 Comment
 
LVL 3

Accepted Solution

by:
williams2 earned 200 total points
Comment Utility
I know your problem, and so does Borland. They have suggested to use Safe Arrays instead. Try to look in help index, and type:
SAFEARRAY

You can pass these directly to the variants. Don't use the standard arrays.
In Delphi 3.0, they are mentioned as TSafeArray.

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now