?
Solved

Delphi1: StringGrid Memleak

Posted on 1998-05-06
3
Medium Priority
?
418 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 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month12 days, 23 hours left to enroll

777 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