Solved

Delphi1: StringGrid Memleak

Posted on 1998-05-06
3
413 Views
Last Modified: 2010-04-06
When i change the ColWidths of a StringGrid in delphi 1 i got some memoryleaks? Is there a patch for this or how can i avoid the memleaks?
ex: StringGrid1.ColWidths[1]:= 100
0
Comment
Question by:ponti
[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
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
inter earned 100 total points
ID: 1342035
Hi
Actually it is not a a memory leak, When you do not assign the colwidth property, Delphi does not allocate anything to it. It just uses the DefaultColWidth to determine the width of columns when drawing. But when you assign something to colwidths it uses Realloc function to allocate and integer array for the widths of the columns. So no need to worry (As far as I know, may someone know about this more)You may ask where do I know? I have just look at the VCL source code for the grids.pas.
Regards,
Igor
0
 

Author Comment

by:ponti
ID: 1342036
But why does the memory monitor for delphi 1 shows a leak when assigning a new value to the colwidths property?
0
 
LVL 5

Expert Comment

by:inter
ID: 1342037
Dear ponti,
Do you have a source code for grids.pas for delphi1.0? If so send it to me and I check for you (Also there is a bug in system.pas in delphi 1 in memory allocation, do you have the updates for delphi that fixes the problem. In this case all mem allocations may resource have resource leaks.) Inany case here is my email
inter@kosgeb.tekmer.gov.tr
Regards,Igor
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

689 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