Shannon V. OKeets
Posts: 22095
Joined: 5/19/2005 From: Honolulu, Hawaii Status: offline
|
quote:
ORIGINAL: SamuraiProgrammer This is something Danny Thorpe (one of the guys who worked on the Delphi VCL for Borland) wrote. 'If you are doing an enormous amount of graphics work in a long running subroutine, you may need to insert an Application.ProcessMessages to allow VCL to release unneeded memory DC's. We do 'garbage collection' on message processing, so if you're in a tight loop, the trash just piles up." Without knowing the method you are using to scale the hexes, I am unsure that this is the problem, but it is very likely that DCs are being created and destroyed fast, hard, and repeatedly. If there is no visible form (i.e. this is a console application), I am not sure how Application.Process messages will respond. In a regular windows app, Application is nil until the main form is initialized. This may also be part of the issue. I don't think console applications process messages in the same ways and this could be preventing the garbage collection from happening. If there is the normal empty form (i.e. a very uninteresting windows application), then this might help. I realize you have worked around the problem already, but I hate it when a possible problem is hanging over my head during development. I hope this gives peace of mind. Sorry if I have ended up being a drain on your time for no reason. Keep up the great work! Dean No, no, not at all. Discussing this with someone is much better than those long-winded conversations I have with myself. I do talk things over with my wife, also a programmer (one of the more clever things I did in this life was to convince her to become a programmer 30 years ago - she makes lots of money) but she doesn't work on Window Applications. "Heavy, heavy what hangs over?" doesn't bother me all that much. If it comes, it comes. It's always the tricky little bugs that at the time are attacking my ankles that drive me batty. From what you wrote, I gather there is a possiblity this problem might not arise (still a very low probability, sigh).
_____________________________
Steve Perfection is an elusive goal.
|