Solved

VarVariant memory leak

Posted on 1998-03-06
1
459 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
williams2 earned 200 total points
ID: 1360207
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month6 days, 5 hours left to enroll

627 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