Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VarVariant memory leak

Posted on 1998-03-06
1
Medium Priority
?
461 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 600 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

705 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