Re: Memory Leak with AnsiString

From: Rudy Velthuis [TeamB] (velthuis_at_gmail.com)
Date: 01/07/05


Date: Fri, 7 Jan 2005 12:28:31 +0100

Michael Anonymous wrote:

> The more intuitive function didn't work and caused memory leaks.

It worked very well and it didn't cause memory leaks at all. The
treatment of global variables by the runtime code did, but that is IMO
no reason to always use a procedure with a var parameter.

Otherwise one could never write functions returning a string anymore.
Something so fundamental would make Delphi rather flawed.

-- 
Rudy Velthuis [TeamB]      http://rvelthuis.bei.t-online.de
"It is time I stepped aside for a less experienced and less able man."
    - Professor Scott Elledge on his retirement from Cornell


Relevant Pages

  • Re: engineering a global type a variable...
    ... While it isn't "incorrect" it is a maintenance hassle. ... I try to keep variables as close to in scope as I can. ... Global variables that are accessed by threads other than the UI are almost always a nightmare to manage. ... Memory leaks are not an issue here. ...
    (microsoft.public.vc.mfc)
  • Re: Global Variable vs Hidden Input TextBoxes
    ... that I might lose global variables due to memory leaks and other ... I think you are being overly-paranoid about memory leaks losing global variables though. ... Chance Favors The Prepared Mind ...
    (comp.lang.javascript)